tripal_cv.DEPRECATED.inc 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. <?php
  2. /**
  3. * @file
  4. * Wrapper functions to provide backwards compatibility for the tripal cv api
  5. */
  6. /**
  7. * @deprecated Restructured API to make naming more readable and consistent.
  8. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  9. * This function has been replaced by tripal_get_cv().
  10. *
  11. * @see tripal_get_cv().
  12. */
  13. function tripal_cv_get_cv($select_values) {
  14. tripal_report_error(
  15. 'tripal_deprecated',
  16. TRIPAL_NOTICE,
  17. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  18. array(
  19. '%old_function'=>'tripal_cv_get_cv',
  20. '%new_function' => 'tripal_get_cv'
  21. )
  22. );
  23. return tripal_get_cv($select_values);
  24. }
  25. /**
  26. * @deprecated Restructured API to make naming more readable and consistent.
  27. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  28. * This function has been replaced by tripal_get_cv().
  29. *
  30. * @see tripal_get_cv().
  31. */
  32. function tripal_cv_get_cv_by_name($name) {
  33. tripal_report_error(
  34. 'tripal_deprecated',
  35. TRIPAL_NOTICE,
  36. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  37. array(
  38. '%old_function'=>'tripal_cv_get_cv_by_name',
  39. '%new_function' => 'tripal_get_cv'
  40. )
  41. );
  42. return tripal_get_cv(array('name' => $name));
  43. }
  44. /**
  45. * @deprecated Restructured API to make naming more readable and consistent.
  46. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  47. * This function has been replaced by tripal_get_cv().
  48. *
  49. * @see tripal_get_cv().
  50. */
  51. function tripal_cv_get_cv_by_id($cv_id) {
  52. tripal_report_error(
  53. 'tripal_deprecated',
  54. TRIPAL_NOTICE,
  55. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  56. array(
  57. '%old_function'=>'tripal_cv_get_cv_by_id',
  58. '%new_function' => 'tripal_get_cv'
  59. )
  60. );
  61. return tripal_get_cv(array('cv_id' => $id));
  62. }
  63. /**
  64. * @deprecated Restructured API to make naming more readable and consistent.
  65. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  66. * This function has been replaced by tripal_get_cv().
  67. *
  68. * @see tripal_get_cv().
  69. */
  70. function tripal_cv_get_cv_id($cv_name) {
  71. tripal_report_error(
  72. 'tripal_deprecated',
  73. TRIPAL_NOTICE,
  74. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  75. array(
  76. '%old_function'=>'tripal_cv_get_cv_id',
  77. '%new_function' => 'tripal_get_cv'
  78. )
  79. );
  80. $cv = tripal_get_cv(array('name' => $cv_name));
  81. if (isset($cv->cv_id)) {
  82. return $cv->cv_id;
  83. }
  84. else {
  85. return FALSE;
  86. }
  87. }
  88. /**
  89. * @deprecated Restructured API to make naming more readable and consistent.
  90. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  91. * This function has been replaced by tripal_get_cv_select_options().
  92. *
  93. * @see tripal_get_cv_select_options().
  94. */
  95. function tripal_cv_get_cv_options() {
  96. tripal_report_error(
  97. 'tripal_deprecated',
  98. TRIPAL_NOTICE,
  99. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  100. array(
  101. '%old_function'=>'tripal_cv_get_cv_options',
  102. '%new_function' => 'tripal_get_cv_select_options'
  103. )
  104. );
  105. return tripal_get_cv_select_options();
  106. }
  107. /**
  108. * @deprecated Restructured API to make naming more readable and consistent.
  109. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  110. * This function has been replaced by tripal_get_cvterm().
  111. *
  112. * @see tripal_get_cvterm().
  113. */
  114. function tripal_cv_get_cvterm_by_id($cvterm_id) {
  115. tripal_report_error(
  116. 'tripal_deprecated',
  117. TRIPAL_NOTICE,
  118. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  119. array(
  120. '%old_function'=>'tripal_cv_get_cvterm_by_id',
  121. '%new_function' => 'tripal_get_cvterm'
  122. )
  123. );
  124. return tripal_get_cvterm(array('cvterm_id' => $cvterm_id));
  125. }
  126. /**
  127. * @deprecated Restructured API to make naming more readable and consistent.
  128. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  129. * This function has been replaced by tripal_get_cvterm().
  130. *
  131. * @see tripal_get_cvterm().
  132. */
  133. function tripal_cv_get_cvterm_by_name($name, $cv_id = NULL, $cv_name = 'tripal') {
  134. tripal_report_error(
  135. 'tripal_deprecated',
  136. TRIPAL_NOTICE,
  137. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  138. array(
  139. '%old_function'=>'tripal_cv_get_cvterm_by_name',
  140. '%new_function' => 'tripal_get_cvterm'
  141. )
  142. );
  143. $identifiers = array('name' => $name);
  144. if (isset($cv_id)) {
  145. $identifiers['cv_id'] = $cv_id;
  146. }
  147. if (isset($cv_name)) {
  148. $identifiers['cv_id'] = array(
  149. 'name' => $cv_name
  150. );
  151. }
  152. return tripal_get_cvterm($identifiers);
  153. }
  154. /**
  155. * @deprecated Restructured API to make naming more readable and consistent.
  156. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  157. * This function has been replaced by tripal_get_cvterm().
  158. *
  159. * @see tripal_get_cvterm().
  160. */
  161. function tripal_cv_get_cvterm_by_synonym($synonym, $cv_id = NULL, $cv_name = 'tripal') {
  162. tripal_report_error(
  163. 'tripal_deprecated',
  164. TRIPAL_NOTICE,
  165. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  166. array(
  167. '%old_function'=>'tripal_cv_get_cvterm_by_synonym',
  168. '%new_function' => 'tripal_get_cvterm'
  169. )
  170. );
  171. return tripal_get_cvterm(array(
  172. 'synonym' => array(
  173. 'name' => $synonym,
  174. 'cv_id' => $cv_id,
  175. 'cv_name' => $cv_name
  176. )
  177. ));
  178. }
  179. /**
  180. * @deprecated Restructured API to make naming more readable and consistent.
  181. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  182. * This function has been replaced by tripal_get_cvterm_select_options().
  183. *
  184. * @see tripal_get_cvterm_select_options().
  185. */
  186. function tripal_cv_get_cvterm_options($cv_id = 0) {
  187. tripal_report_error(
  188. 'tripal_deprecated',
  189. TRIPAL_NOTICE,
  190. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  191. array(
  192. '%old_function'=>'tripal_cv_get_cvterm_options',
  193. '%new_function' => 'tripal_get_cvterm_select_options'
  194. )
  195. );
  196. return tripal_get_cvterm_select_options($cv_id);
  197. }
  198. /**
  199. * @deprecated Restructured API to make naming more readable and consistent.
  200. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  201. * This function has been replaced by tripal_update_cvtermpath().
  202. *
  203. * @see tripal_update_cvtermpath().
  204. */
  205. function tripal_cv_update_cvtermpath($cvid, $job_id = NULL) {
  206. tripal_report_error(
  207. 'tripal_deprecated',
  208. TRIPAL_NOTICE,
  209. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  210. array(
  211. '%old_function'=>'tripal_cv_update_cvtermpath',
  212. '%new_function' => 'tripal_update_cvtermpath'
  213. )
  214. );
  215. return tripal_update_cvtermpath($cvid, $job_id);
  216. }
  217. /**
  218. * @deprecated Restructured API to make naming more readable and consistent.
  219. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  220. * This function has been replaced by tripal_insert_cv().
  221. *
  222. * @see tripal_insert_cv().
  223. */
  224. function tripal_cv_add_cv($name, $definition) {
  225. tripal_report_error(
  226. 'tripal_deprecated',
  227. TRIPAL_NOTICE,
  228. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  229. array(
  230. '%old_function'=>'tripal_cv_add_cv',
  231. '%new_function' => 'tripal_insert_cv'
  232. )
  233. );
  234. return tripal_insert_cv($name, $definition);
  235. }
  236. /**
  237. * @deprecated Restructured API to make naming more readable and consistent.
  238. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  239. * This function has been replaced by tripal_insert_cvterm().
  240. *
  241. * @see tripal_insert_cvterm().
  242. */
  243. function tripal_cv_add_cvterm($term, $defaultcv = '_global', $is_relationship = 0, $update = 1, $dbname = 'internal') {
  244. tripal_report_error(
  245. 'tripal_deprecated',
  246. TRIPAL_NOTICE,
  247. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  248. array(
  249. '%old_function'=>'tripal_cv_add_cvterm',
  250. '%new_function' => 'tripal_insert_cvterm'
  251. )
  252. );
  253. $term['cv_name'] = $defaultcv;
  254. $term['db_name'] = $dbname;
  255. $term['is_relationship'] = $is_relationship;
  256. if (isset($term['def'])) {
  257. $term['definition'] = $term['def'];
  258. unset($term['def']);
  259. }
  260. return tripal_insert_cvterm(
  261. $term,
  262. array(
  263. 'update_existing' => $update
  264. )
  265. );
  266. }
  267. /**
  268. * @deprecated Restructured API to make naming more readable and consistent.
  269. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  270. * This function has been replaced by tripal_submit_obo_job().
  271. *
  272. * @see tripal_submit_obo_job().
  273. */
  274. function tripal_cv_submit_obo_job($obo_id = NULL, $obo_name = NULL, $obo_url = NULL, $obo_file = NULL) {
  275. tripal_report_error(
  276. 'tripal_deprecated',
  277. TRIPAL_NOTICE,
  278. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  279. array(
  280. '%old_function'=>'tripal_cv_submit_obo_job',
  281. '%new_function' => 'tripal_submit_obo_job'
  282. )
  283. );
  284. return tripal_submit_obo_job(
  285. array(
  286. 'obo_id' => $obo_id,
  287. 'name' => $obo_name,
  288. 'url' => $obo_url,
  289. 'file' => $obo_file
  290. )
  291. );
  292. }
  293. /**
  294. * @deprecated Restructured API to make naming more readable and consistent.
  295. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  296. * This function has been replaced by tripal_insert_obo().
  297. *
  298. * @see tripal_insert_obo().
  299. */
  300. function tripal_cv_add_obo_ref($name, $path) {
  301. tripal_report_error(
  302. 'tripal_deprecated',
  303. TRIPAL_NOTICE,
  304. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  305. array(
  306. '%old_function'=>'tripal_cv_add_obo_ref',
  307. '%new_function' => 'chado_insert_obo'
  308. )
  309. );
  310. return tripal_insert_obo($name, $path);
  311. }
  312. /**
  313. * @deprecated Restructured API to make naming more readable and consistent.
  314. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  315. * This function has been replaced by tripal_autocomplete_cvterm().
  316. *
  317. * @see tripal_autocomplete_cvterm().
  318. */
  319. function tripal_cv_cvterm_name_autocomplete($cv_id, $string = '') {
  320. tripal_report_error(
  321. 'tripal_deprecated',
  322. TRIPAL_NOTICE,
  323. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  324. array(
  325. '%old_function'=>'tripal_cv_cvterm_name_autocomplete',
  326. '%new_function' => 'tripal_autocomplete_cvterm'
  327. )
  328. );
  329. return tripal_autocomplete_cvterm($cv_id, $string);
  330. }