tripal_cv.DEPRECATED.inc 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  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 chado_get_cv().
  10. *
  11. * @see chado_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' => 'chado_get_cv'
  21. )
  22. );
  23. return chado_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 chado_get_cv().
  29. *
  30. * @see chado_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' => 'chado_get_cv'
  40. )
  41. );
  42. return chado_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 chado_get_cv().
  48. *
  49. * @see chado_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' => 'chado_get_cv'
  59. )
  60. );
  61. return chado_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 chado_get_cv().
  67. *
  68. * @see chado_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' => 'chado_get_cv'
  78. )
  79. );
  80. $cv = chado_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 cv_get_select_options().
  92. *
  93. * @see cv_get_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' => 'cv_get_select_options'
  103. )
  104. );
  105. return cv_get_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 chado_get_cvterm().
  111. *
  112. * @see chado_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' => 'chado_get_cvterm'
  122. )
  123. );
  124. return chado_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 chado_get_cvterm().
  130. *
  131. * @see chado_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' => 'chado_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 chado_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 chado_get_cvterm().
  158. *
  159. * @see chado_get_cvterm().
  160. */
  161. function tripal_cv_get_cvterm_by_synonym($synonym, $cv_id = NULL, $cv_name = 'tripal') {
  162. tripal_report_error('tripal_deprecated', TRIPAL_NOTICE,
  163. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  164. array(
  165. '%old_function'=>'tripal_cv_get_cvterm_by_synonym',
  166. '%new_function' => 'chado_get_cvterm'
  167. )
  168. );
  169. return chado_get_cvterm(array(
  170. 'synonym' => array(
  171. 'name' => $synonym,
  172. 'cv_id' => $cv_id,
  173. 'cv_name' => $cv_name
  174. )
  175. ));
  176. }
  177. /**
  178. * @deprecated Restructured API to make naming more readable and consistent.
  179. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  180. * This function has been replaced by cvterm_get_select_options().
  181. *
  182. * @see cvterm_get_select_options().
  183. */
  184. function tripal_cv_get_cvterm_options($cv_id = 0) {
  185. tripal_report_error(
  186. 'tripal_deprecated',
  187. TRIPAL_NOTICE,
  188. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  189. array(
  190. '%old_function'=>'tripal_cv_get_cvterm_options',
  191. '%new_function' => 'cvterm_get_select_options'
  192. )
  193. );
  194. return cvterm_get_select_options($cv_id);
  195. }
  196. /**
  197. * @deprecated Restructured API to make naming more readable and consistent.
  198. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  199. * This function has been replaced by chado_update_cvtermpath().
  200. *
  201. * @see chado_update_cvtermpath().
  202. */
  203. function tripal_cv_update_cvtermpath($cvid, $job_id = NULL) {
  204. tripal_report_error(
  205. 'tripal_deprecated',
  206. TRIPAL_NOTICE,
  207. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  208. array(
  209. '%old_function'=>'tripal_cv_update_cvtermpath',
  210. '%new_function' => 'chado_update_cvtermpath'
  211. )
  212. );
  213. return chado_update_cvtermpath($cvid, $job_id);
  214. }
  215. /**
  216. * @deprecated Restructured API to make naming more readable and consistent.
  217. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  218. * This function has been replaced by chado_insert_cv().
  219. *
  220. * @see chado_insert_cv().
  221. */
  222. function tripal_cv_add_cv($name, $definition) {
  223. tripal_report_error(
  224. 'tripal_deprecated',
  225. TRIPAL_NOTICE,
  226. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  227. array(
  228. '%old_function'=>'tripal_cv_add_cv',
  229. '%new_function' => 'chado_insert_cv'
  230. )
  231. );
  232. return chado_insert_cv($name, $definition);
  233. }
  234. /**
  235. * @deprecated Restructured API to make naming more readable and consistent.
  236. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  237. * This function has been replaced by chado_insert_cvterm().
  238. *
  239. * @see chado_insert_cvterm().
  240. */
  241. function tripal_cv_add_cvterm($term, $defaultcv = '_global', $is_relationship = 0, $update = 1, $dbname = 'internal') {
  242. tripal_report_error(
  243. 'tripal_deprecated',
  244. TRIPAL_NOTICE,
  245. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  246. array(
  247. '%old_function'=>'tripal_cv_add_cvterm',
  248. '%new_function' => 'chado_insert_cvterm'
  249. )
  250. );
  251. $term['cv_name'] = $defaultcv;
  252. $term['db_name'] = $dbname;
  253. $term['is_relationship'] = $is_relationship;
  254. if (isset($term['def'])) {
  255. $term['definition'] = $term['def'];
  256. unset($term['def']);
  257. }
  258. return chado_insert_cvterm(
  259. $term,
  260. array(
  261. 'update_existing' => $update
  262. )
  263. );
  264. }
  265. /**
  266. * @deprecated Restructured API to make naming more readable and consistent.
  267. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  268. * This function has been replaced by tripal_submit_obo_job().
  269. *
  270. * @see tripal_submit_obo_job().
  271. */
  272. function tripal_cv_submit_obo_job($obo_id = NULL, $obo_name = NULL, $obo_url = NULL, $obo_file = NULL) {
  273. tripal_report_error(
  274. 'tripal_deprecated',
  275. TRIPAL_NOTICE,
  276. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  277. array(
  278. '%old_function'=>'tripal_cv_submit_obo_job',
  279. '%new_function' => 'tripal_submit_obo_job'
  280. )
  281. );
  282. return tripal_submit_obo_job(
  283. array(
  284. 'obo_id' => $obo_id,
  285. 'name' => $obo_name,
  286. 'url' => $obo_url,
  287. 'file' => $obo_file
  288. )
  289. );
  290. }
  291. /**
  292. * @deprecated Restructured API to make naming more readable and consistent.
  293. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  294. * This function has been replaced by tripal_insert_obo().
  295. *
  296. * @see tripal_insert_obo().
  297. */
  298. function tripal_cv_add_obo_ref($name, $path) {
  299. tripal_report_error(
  300. 'tripal_deprecated',
  301. TRIPAL_NOTICE,
  302. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  303. array(
  304. '%old_function'=>'tripal_cv_add_obo_ref',
  305. '%new_function' => 'chado_insert_obo'
  306. )
  307. );
  308. return tripal_insert_obo($name, $ref);
  309. }
  310. /**
  311. * @deprecated Restructured API to make naming more readable and consistent.
  312. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  313. * This function has been replaced by chado_cvterm_autocomplete().
  314. *
  315. * @see chado_cvterm_autocomplete().
  316. */
  317. function tripal_cv_cvterm_name_autocomplete($cv_id, $string = '') {
  318. tripal_report_error(
  319. 'tripal_deprecated',
  320. TRIPAL_NOTICE,
  321. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  322. array(
  323. '%old_function'=>'tripal_cv_cvterm_name_autocomplete',
  324. '%new_function' => 'chado_cvterm_autocomplete'
  325. )
  326. );
  327. return chado_cvterm_autocomplete($cv_id, $string);
  328. }