tripal_core.DEPRECATED.inc 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465
  1. <?php
  2. /**
  3. * @file
  4. * Contains all the deprecated functions to keep the tripal api backwards
  5. * compatible.
  6. */
  7. /**
  8. * @deprecated Restructured API to make naming more readable and consistent.
  9. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  10. * now. This function has been replaced by chado_get_id_from_nid().
  11. *
  12. * @see chado_get_id_from_nid()
  13. */
  14. function chado_get_id_for_node($table, $node) {
  15. tripal_report_error(
  16. 'tripal_deprecated',
  17. TRIPAL_NOTICE,
  18. "DEPRECATED: %old_function has been replaced with %new_function. The arguments have been changed slightly (ie: $nid instead of $node). Please update your code.",
  19. [
  20. '%old_function' => 'chado_get_id_for_node',
  21. '%new_function' => 'chado_get_id_from_nid',
  22. ]
  23. );
  24. //New API Function
  25. return chado_get_id_from_nid($table, $node->nid);
  26. }
  27. /**
  28. * @deprecated Restructured API to make naming more readable and consistent.
  29. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  30. * now. This function has been replaced by chado_get_nid_from_id().
  31. *
  32. * @see chado_get_nid_from_id().
  33. */
  34. function chado_get_node_id($table, $id) {
  35. tripal_report_error(
  36. 'tripal_deprecated',
  37. TRIPAL_NOTICE,
  38. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  39. [
  40. '%old_function' => 'chado_get_node_id',
  41. '%new_function' => 'chado_get_nid_from_id',
  42. ]
  43. );
  44. //New API Function
  45. return chado_get_nid_from_id($table, $id);
  46. }
  47. /**
  48. * @deprecated Restructured API to make naming more readable and consistent.
  49. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  50. * now. This function has been replaced by chado_cleanup_orphaned_nodes().
  51. *
  52. * @see chado_cleanup_orphaned_nodes().
  53. */
  54. function tripal_core_chado_node_cleanup_orphaned($table, $job_id = NULL) {
  55. tripal_report_error(
  56. 'tripal_deprecated',
  57. TRIPAL_NOTICE,
  58. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  59. [
  60. '%old_function' => 'tripal_core_chado_node_cleanup_orphaned',
  61. '%new_function' => 'chado_cleanup_orphaned_nodes',
  62. ]
  63. );
  64. //New API Function
  65. return chado_cleanup_orphaned_nodes($table, $job_id);
  66. }
  67. /**
  68. * @deprecated Restructured API to make naming more readable and consistent.
  69. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  70. * now. This function has been replaced by chado_add_node_form_dbxrefs().
  71. *
  72. * @see chado_add_node_form_dbxrefs().
  73. */
  74. function chado_node_additional_dbxrefs_form(&$form, &$form_state, $details) {
  75. tripal_report_error(
  76. 'tripal_deprecated',
  77. TRIPAL_NOTICE,
  78. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  79. [
  80. '%old_function' => 'chado_node_additional_dbxrefs_form',
  81. '%new_function' => 'chado_add_node_form_dbxrefs',
  82. ]
  83. );
  84. //New API Function
  85. return chado_add_node_form_dbxrefs($form, $form_state, $details);
  86. }
  87. /**
  88. * @deprecated Restructured API to make naming more readable and consistent.
  89. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  90. * now. This function has been replaced by
  91. * chado_retrieve_node_form_dbxrefs().
  92. *
  93. * @see chado_retrieve_node_form_dbxrefs().
  94. */
  95. function chado_node_additional_dbxrefs_form_retreive($node) {
  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. [
  101. '%old_function' => 'chado_node_additional_dbxrefs_form_retreive',
  102. '%new_function' => 'chado_retrieve_node_form_dbxrefs',
  103. ]
  104. );
  105. //New API Function
  106. return chado_retrieve_node_form_dbxrefs($node);
  107. }
  108. /**
  109. * @deprecated Restructured API to make naming more readable and consistent.
  110. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  111. * now. This function has been replaced by chado_update_node_form_dbxrefs().
  112. *
  113. * @see chado_update_node_form_dbxrefs().
  114. */
  115. function chado_node_additional_dbxrefs_form_update_dbxrefs($node, $details, $retrieved_dbxrefs = FALSE) {
  116. tripal_report_error(
  117. 'tripal_deprecated',
  118. TRIPAL_NOTICE,
  119. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  120. [
  121. '%old_function' => 'chado_node_additional_dbxrefs_form_update_dbxrefs',
  122. '%new_function' => 'chado_update_node_form_dbxrefs',
  123. ]
  124. );
  125. //New API Function
  126. return chado_update_node_form_dbxrefs($node, $details, $retrieved_dbxrefs);
  127. }
  128. /**
  129. * @deprecated Restructured API to make naming more readable and consistent.
  130. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  131. * now. This function has been replaced by chado_add_node_form_properties().
  132. *
  133. * @see chado_add_node_form_properties().
  134. */
  135. function chado_node_properties_form($form, &$form_state, $details) {
  136. tripal_report_error(
  137. 'tripal_deprecated',
  138. TRIPAL_NOTICE,
  139. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  140. [
  141. '%old_function' => 'chado_node_properties_form',
  142. '%new_function' => 'chado_add_node_form_properties',
  143. ]
  144. );
  145. //New API Function
  146. return chado_add_node_form_properties($form, $form_state, $details);
  147. }
  148. /**
  149. * @deprecated Restructured API to make naming more readable and consistent.
  150. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  151. * now. This function has been replaced by
  152. * chado_retrieve_node_form_properties().
  153. *
  154. * @see chado_retrieve_node_form_properties().
  155. */
  156. function chado_node_properties_form_retreive($node) {
  157. tripal_report_error(
  158. 'tripal_deprecated',
  159. TRIPAL_NOTICE,
  160. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  161. [
  162. '%old_function' => 'chado_node_properties_form_retreive',
  163. '%new_function' => 'chado_retrieve_node_form_properties',
  164. ]
  165. );
  166. //New API Function
  167. return chado_retrieve_node_form_properties($node);
  168. }
  169. /**
  170. * @deprecated Restructured API to make naming more readable and consistent.
  171. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  172. * now. This function has been replaced by
  173. * chado_update_node_form_properties().
  174. *
  175. * @see chado_update_node_form_properties().
  176. */
  177. function chado_node_properties_form_update_properties($node, $details, $retrieved_properties = FALSE) {
  178. tripal_report_error(
  179. 'tripal_deprecated',
  180. TRIPAL_NOTICE,
  181. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  182. [
  183. '%old_function' => 'chado_node_properties_form_update_properties',
  184. '%new_function' => 'chado_update_node_form_properties',
  185. ]
  186. );
  187. //New API Function
  188. return chado_update_node_form_properties($node, $details, $retrieved_properties);
  189. }
  190. /**
  191. * @deprecated Restructured API to make naming more readable and consistent.
  192. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  193. * now. This function has been replaced by
  194. * chado_add_node_form_relationships().
  195. *
  196. * @see chado_add_node_form_relationships().
  197. */
  198. function chado_node_relationships_form(&$form, &$form_state, $details) {
  199. tripal_report_error(
  200. 'tripal_deprecated',
  201. TRIPAL_NOTICE,
  202. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  203. [
  204. '%old_function' => 'chado_node_relationships_form',
  205. '%new_function' => 'chado_add_node_form_relationships',
  206. ]
  207. );
  208. //New API Function
  209. return chado_add_node_form_relationships($form, $form_state, $details);
  210. }
  211. /**
  212. * @deprecated Restructured API to make naming more readable and consistent.
  213. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  214. * now. This function has been replaced by
  215. * chado_retrieve_node_form_relationships().
  216. *
  217. * @see chado_retrieve_node_form_relationships().
  218. */
  219. function chado_node_relationships_form_retreive($node) {
  220. tripal_report_error(
  221. 'tripal_deprecated',
  222. TRIPAL_NOTICE,
  223. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  224. [
  225. '%old_function' => 'chado_node_relationships_form_retreive',
  226. '%new_function' => 'chado_retrieve_node_form_relationships',
  227. ]
  228. );
  229. //New API Function
  230. return chado_retrieve_node_form_relationships($node);
  231. }
  232. /**
  233. * @deprecated Restructured API to make naming more readable and consistent.
  234. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  235. * now. This function has been replaced by
  236. * chado_update_node_form_relationships().
  237. *
  238. * @see chado_update_node_form_relationships().
  239. */
  240. function chado_node_relationships_form_update_relationships($node, $details, $retrieved_relationships = FALSE) {
  241. tripal_report_error(
  242. 'tripal_deprecated',
  243. TRIPAL_NOTICE,
  244. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  245. [
  246. '%old_function' => 'chado_node_relationships_form_update_relationships',
  247. '%new_function' => 'chado_update_node_form_relationships',
  248. ]
  249. );
  250. //New API Function
  251. return chado_update_node_form_relationships($node, $details, $retrieved_relationships);
  252. }
  253. /**
  254. * @deprecated Restructured API to make naming more readable and consistent.
  255. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  256. * now. This function has been replaced by chado_node_sync_form().
  257. *
  258. * @see chado_node_sync_form().
  259. */
  260. function tripal_core_chado_node_sync_form($form, &$form_state) {
  261. tripal_report_error(
  262. 'tripal_deprecated',
  263. TRIPAL_NOTICE,
  264. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  265. [
  266. '%old_function' => 'tripal_core_chado_node_sync_form',
  267. '%new_function' => 'chado_node_sync_form',
  268. ]
  269. );
  270. //New API Function
  271. return chado_node_sync_form($form, $form_state);
  272. }
  273. /**
  274. * @deprecated Restructured API to make naming more readable and consistent.
  275. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  276. * now. This function has been replaced by chado_node_sync_records().
  277. *
  278. * @see chado_node_sync_records().
  279. */
  280. function tripal_core_chado_node_sync_records($base_table, $max_sync = FALSE, $organism_id = FALSE,
  281. $types = [], $ids = [], $job_id = NULL) {
  282. tripal_report_error(
  283. 'tripal_deprecated',
  284. TRIPAL_NOTICE,
  285. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  286. [
  287. '%old_function' => 'tripal_core_chado_node_sync_records',
  288. '%new_function' => 'chado_node_sync_records',
  289. ]
  290. );
  291. //New API Function
  292. return chado_node_sync_records($base_table, $max_sync, $organism_id, $types, $ids, $job_id);
  293. }
  294. /**
  295. * @deprecated Restructured API to make naming more readable and consistent.
  296. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  297. * now. There is no new functionality as this function was deamed
  298. * unnecessary.
  299. */
  300. function tripal_core_is_tripal_node_type() {
  301. tripal_report_error(
  302. 'tripal_deprecated',
  303. TRIPAL_ERROR,
  304. "DEPRECATED: %old_function has been completely removed since we felt there wasn't a real need for it.",
  305. [
  306. '%old_function' => 'tripal_core_is_tripal_node_type',
  307. ]
  308. );
  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
  313. * now. This function has been replaced by chado_schema_get_foreign_key().
  314. *
  315. * @see chado_schema_get_foreign_key().
  316. */
  317. function tripal_core_chado_get_foreign_key($table_desc, $field, $values, $options = NULL) {
  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. [
  323. '%old_function' => 'tripal_core_chado_get_foreign_key',
  324. '%new_function' => 'chado_schema_get_foreign_key',
  325. ]
  326. );
  327. //New API Function
  328. return chado_schema_get_foreign_key($table_desc, $field, $values, $options);
  329. }
  330. /**
  331. * @deprecated Restructured API to make naming more readable and consistent.
  332. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  333. * now. This function has been replaced by chado_delete_record().
  334. *
  335. * @see chado_delete_record().
  336. */
  337. function tripal_core_chado_delete($table, $match, $options = NULL) {
  338. tripal_report_error(
  339. 'tripal_deprecated',
  340. TRIPAL_NOTICE,
  341. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  342. [
  343. '%old_function' => 'tripal_core_chado_delete',
  344. '%new_function' => 'chado_delete_record',
  345. ]
  346. );
  347. //New API Function
  348. return chado_delete_record($table, $match, $options);
  349. }
  350. /**
  351. * @deprecated Restructured API to make naming more readable and consistent.
  352. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  353. * now. This function has been replaced by chado_expand_var().
  354. *
  355. * @see chado_expand_var().
  356. */
  357. function tripal_core_expand_chado_vars($object, $type, $to_expand, $table_options = []) {
  358. tripal_report_error(
  359. 'tripal_deprecated',
  360. TRIPAL_NOTICE,
  361. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  362. [
  363. '%old_function' => 'tripal_core_expand_chado_vars',
  364. '%new_function' => 'chado_expand_var',
  365. ]
  366. );
  367. //New API Function
  368. return chado_expand_var($object, $type, $to_expand, $table_options);
  369. }
  370. /**
  371. * @deprecated Restructured API to make naming more readable and consistent.
  372. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  373. * now. This function has been replaced by chado_generate_var().
  374. *
  375. * @see chado_generate_var().
  376. */
  377. function tripal_core_generate_chado_var($table, $values, $base_options = []) {
  378. tripal_report_error(
  379. 'tripal_deprecated',
  380. TRIPAL_NOTICE,
  381. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  382. [
  383. '%old_function' => 'tripal_core_generate_chado_var',
  384. '%new_function' => 'chado_generate_var',
  385. ]
  386. );
  387. //New API Function
  388. return chado_generate_var($table, $values, $base_options);
  389. }
  390. /**
  391. * @deprecated Restructured API to make naming more readable and consistent.
  392. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  393. * now. This function has been replaced by chado_insert_record().
  394. *
  395. * @see chado_insert_record().
  396. */
  397. function tripal_core_chado_insert($table, $values, $options = []) {
  398. tripal_report_error(
  399. 'tripal_deprecated',
  400. TRIPAL_NOTICE,
  401. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  402. [
  403. '%old_function' => 'tripal_core_chado_insert',
  404. '%new_function' => 'chado_insert_record',
  405. ]
  406. );
  407. //New API Function
  408. return chado_insert_record($table, $values, $options);
  409. }
  410. /**
  411. * @deprecated Restructured API to make naming more readable and consistent.
  412. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  413. * now. This function has been replaced by chado_select_record().
  414. *
  415. * @see chado_select_record().
  416. */
  417. function tripal_core_chado_select($table, $columns, $values, $options = NULL) {
  418. tripal_report_error(
  419. 'tripal_deprecated',
  420. TRIPAL_NOTICE,
  421. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  422. [
  423. '%old_function' => 'tripal_core_chado_select',
  424. '%new_function' => 'chado_select_record',
  425. ]
  426. );
  427. //New API Function
  428. return chado_select_record($table, $columns, $values, $options);
  429. }
  430. /**
  431. * @deprecated Restructured API to make naming more readable and consistent.
  432. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  433. * now. This function has been replaced by chado_update_record().
  434. *
  435. * @see chado_update_record().
  436. */
  437. function tripal_core_chado_update($table, $match, $values, $options = NULL) {
  438. tripal_report_error(
  439. 'tripal_deprecated',
  440. TRIPAL_NOTICE,
  441. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  442. [
  443. '%old_function' => 'tripal_core_chado_update',
  444. '%new_function' => 'chado_update_record',
  445. ]
  446. );
  447. //New API Function
  448. return chado_update_record($table, $match, $values, $options);
  449. }
  450. /**
  451. * @deprecated Restructured API to make naming more readable and consistent.
  452. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  453. * now. This function has been replaced by tripal_create_files_dir().
  454. *
  455. * @see tripal_create_files_dir().
  456. */
  457. function tripal_create_moddir($module_name) {
  458. tripal_report_error(
  459. 'tripal_deprecated',
  460. TRIPAL_NOTICE,
  461. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  462. [
  463. '%old_function' => 'tripal_create_moddir',
  464. '%new_function' => 'tripal_create_files_dir',
  465. ]
  466. );
  467. //New API Function
  468. return tripal_create_files_dir($module_name);
  469. }
  470. /**
  471. * @deprecated Restructured API to make naming more readable and consistent.
  472. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  473. * now. This function has been replaced by tripal_create_files_dir().
  474. *
  475. * @see tripal_create_files_dir().
  476. */
  477. function tripal_create_mod_subdir($module_name, $path) {
  478. tripal_report_error(
  479. 'tripal_deprecated',
  480. TRIPAL_NOTICE,
  481. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  482. [
  483. '%old_function' => 'tripal_create_mod_subdir',
  484. '%new_function' => 'tripal_create_files_dir',
  485. ]
  486. );
  487. //New API Function
  488. return tripal_create_files_dir($module_name, $path);
  489. }
  490. /**
  491. * @deprecated Restructured API to make naming more readable and consistent.
  492. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  493. * now. This function has been replaced by tripal_create_files_dir().
  494. *
  495. * @see tripal_create_files_dir().
  496. * @todo Remove. This was not in Tripal 1.x.
  497. */
  498. function tripal_file_directory_path() {
  499. tripal_report_error(
  500. 'tripal_deprecated',
  501. TRIPAL_NOTICE,
  502. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  503. [
  504. '%old_function' => 'tripal_file_directory_path',
  505. '%new_function' => 'tripal_get_files_dir',
  506. ]
  507. );
  508. //New API Function
  509. return tripal_get_files_dir();
  510. }
  511. /**
  512. * @deprecated Restructured API to make naming more readable and consistent.
  513. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  514. * now. This function has been replaced by tripal_get_files_dir().
  515. *
  516. * @see tripal_get_files_dir().
  517. */
  518. function tripal_get_moddir($module_name) {
  519. tripal_report_error(
  520. 'tripal_deprecated',
  521. TRIPAL_NOTICE,
  522. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  523. [
  524. '%old_function' => 'tripal_get_moddir',
  525. '%new_function' => 'tripal_get_files_dir',
  526. ]
  527. );
  528. //New API Function
  529. return tripal_get_files_dir($module_name);
  530. }
  531. /**
  532. * @deprecated Restructured API to make naming more readable and consistent.
  533. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  534. * now. This function has been replaced by tripal_cancel_job().
  535. *
  536. * @see tripal_cancel_job().
  537. */
  538. function tripal_jobs_cancel($job_id, $redirect = TRUE) {
  539. tripal_report_error(
  540. 'tripal_deprecated',
  541. TRIPAL_NOTICE,
  542. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  543. [
  544. '%old_function' => 'tripal_jobs_cancel',
  545. '%new_function' => 'tripal_cancel_job',
  546. ]
  547. );
  548. //New API Function
  549. return tripal_cancel_job($job_id);
  550. }
  551. /**
  552. * @deprecated Restructured API to make naming more readable and consistent.
  553. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  554. * now. This function has been replaced by tripal_get_active_jobs().
  555. *
  556. * @see tripal_get_active_jobs().
  557. */
  558. function tripal_get_module_active_jobs($modulename) {
  559. tripal_report_error(
  560. 'tripal_deprecated',
  561. TRIPAL_NOTICE,
  562. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  563. [
  564. '%old_function' => 'tripal_get_module_active_jobs',
  565. '%new_function' => 'tripal_get_active_jobs',
  566. ]
  567. );
  568. //New API Function
  569. return tripal_get_active_jobs($modulename);
  570. }
  571. /**
  572. * @deprecated Restructured API to make naming more readable and consistent.
  573. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  574. * now. This function has been replaced by tripal_get_job_end().
  575. *
  576. * @see tripal_get_job_end().
  577. */
  578. function tripal_jobs_get_end_time($job) {
  579. tripal_report_error(
  580. 'tripal_deprecated',
  581. TRIPAL_NOTICE,
  582. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  583. [
  584. '%old_function' => 'tripal_jobs_get_end_time',
  585. '%new_function' => 'tripal_get_job_end',
  586. ]
  587. );
  588. //New API Function
  589. return tripal_get_job_end($job);
  590. }
  591. /**
  592. * @deprecated Restructured API to make naming more readable and consistent.
  593. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  594. * now. This function has been replaced by tripal_get_job_start().
  595. *
  596. * @see tripal_get_job_start().
  597. */
  598. function tripal_jobs_get_start_time($job) {
  599. tripal_report_error(
  600. 'tripal_deprecated',
  601. TRIPAL_NOTICE,
  602. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  603. [
  604. '%old_function' => 'tripal_jobs_get_start_time',
  605. '%new_function' => 'tripal_get_job_start',
  606. ]
  607. );
  608. //New API Function
  609. return tripal_get_job_start($job);
  610. }
  611. /**
  612. * @deprecated Restructured API to make naming more readable and consistent.
  613. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  614. * now. This function has been replaced by tripal_get_job_submit_date().
  615. *
  616. * @see tripal_get_job_submit_date().
  617. */
  618. function tripal_jobs_get_submit_date($job) {
  619. tripal_report_error(
  620. 'tripal_deprecated',
  621. TRIPAL_NOTICE,
  622. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  623. [
  624. '%old_function' => 'tripal_jobs_get_submit_date',
  625. '%new_function' => 'tripal_get_job_submit_date',
  626. ]
  627. );
  628. //New API Function
  629. return tripal_get_job_submit_date($job);
  630. }
  631. /**
  632. * @deprecated Restructured API to make naming more readable and consistent.
  633. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  634. * now. This function has been replaced by tripal_is_job_running().
  635. *
  636. * @see tripal_is_job_running().
  637. */
  638. function tripal_jobs_check_running() {
  639. tripal_report_error(
  640. 'tripal_deprecated',
  641. TRIPAL_NOTICE,
  642. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  643. [
  644. '%old_function' => 'tripal_jobs_check_running',
  645. '%new_function' => 'tripal_is_job_running',
  646. ]
  647. );
  648. //New API Function
  649. return tripal_is_job_running();
  650. }
  651. /**
  652. * @deprecated Restructured API to make naming more readable and consistent.
  653. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  654. * now. This function has been replaced by tripal_launch_job().
  655. *
  656. * @see tripal_launch_job().
  657. */
  658. function tripal_jobs_launch($do_parallel = 0, $job_id = NULL) {
  659. tripal_report_error(
  660. 'tripal_deprecated',
  661. TRIPAL_NOTICE,
  662. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  663. [
  664. '%old_function' => 'tripal_jobs_launch',
  665. '%new_function' => 'tripal_launch_job',
  666. ]
  667. );
  668. //New API Function
  669. return tripal_launch_job($do_parallel, $job_id);
  670. }
  671. /**
  672. * @deprecated Restructured API to make naming more readable and consistent.
  673. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  674. * now. This function has been replaced by tripal_rerun_job().
  675. *
  676. * @see tripal_rerun_job().
  677. */
  678. function tripal_jobs_rerun($job_id, $goto_jobs_page = TRUE) {
  679. tripal_report_error(
  680. 'tripal_deprecated',
  681. TRIPAL_NOTICE,
  682. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  683. [
  684. '%old_function' => 'tripal_jobs_rerun',
  685. '%new_function' => 'tripal_rerun_job',
  686. ]
  687. );
  688. //New API Function
  689. return tripal_rerun_job($job_id, $goto_jobs_page);
  690. }
  691. /**
  692. * @deprecated Restructured API to make naming more readable and consistent.
  693. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  694. * now. This function has been replaced by tripal_set_job_progress().
  695. *
  696. * @see tripal_set_job_progress().
  697. */
  698. function tripal_job_set_progress($job_id, $percentage) {
  699. tripal_report_error(
  700. 'tripal_deprecated',
  701. TRIPAL_NOTICE,
  702. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  703. [
  704. '%old_function' => 'tripal_job_set_progress',
  705. '%new_function' => 'tripal_set_job_progress',
  706. ]
  707. );
  708. //New API Function
  709. return tripal_set_job_progress($job_id, $percentage);
  710. }
  711. /**
  712. * @deprecated Restructured API to make naming more readable and consistent.
  713. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  714. * now. This function has been replaced by tripal_refresh_mview(), and
  715. * tripal_delete_mview().
  716. *
  717. * @see tripal_refresh_mview() or tripal_delete_mview().
  718. */
  719. function tripal_mviews_action($op, $mview_id, $redirect = FALSE) {
  720. if ($op == 'update') {
  721. tripal_report_error(
  722. 'tripal_deprecated',
  723. TRIPAL_NOTICE,
  724. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  725. [
  726. '%old_function' => 'tripal_mviews_action',
  727. '%new_function' => 'tripal_refresh_mview',
  728. ]
  729. );
  730. //New API Function
  731. $ret = tripal_refresh_mview($mview_id, $redirect);
  732. if ($redirect) {
  733. drupal_goto("admin/tripal/storage/chado/mviews");
  734. }
  735. return $ret;
  736. }
  737. if ($op == 'delete') {
  738. tripal_report_error(
  739. 'tripal_deprecated',
  740. TRIPAL_NOTICE,
  741. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  742. [
  743. '%old_function' => 'tripal_mviews_action',
  744. '%new_function' => 'tripal_delete_mview',
  745. ]
  746. );
  747. //New API Function
  748. $ret = tripal_delete_mview($mview_id, $redirect);
  749. if ($redirect) {
  750. drupal_goto("admin/tripal/storage/chado/mviews");
  751. }
  752. return $ret;
  753. }
  754. }
  755. /**
  756. * @deprecated Restructured API to make naming more readable and consistent.
  757. * Function was deprecated in Tripal 1.0 and will is in the process of being
  758. * removed.
  759. */
  760. function tripal_add_legacy_mview($name, $modulename, $mv_table, $mv_specs, $indexed,
  761. $query, $special_index, $comment) {
  762. tripal_report_error(
  763. 'tripal_deprecated',
  764. TRIPAL_ERROR,
  765. "DEPRECATED: %old_function has been completely removed after a period of two releases
  766. since deprecation. Please use the new Materialized View Interface.",
  767. [
  768. '%old_function' => 'tripal_add_legacy_mview',
  769. ]
  770. );
  771. }
  772. /**
  773. * @deprecated Restructured API to make naming more readable and consistent.
  774. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  775. * now. This function has been replaced by tripal_populate_mview().
  776. *
  777. * @see tripal_populate_mview().
  778. */
  779. function tripal_update_mview($mview_id) {
  780. tripal_report_error(
  781. 'tripal_deprecated',
  782. TRIPAL_NOTICE,
  783. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  784. [
  785. '%old_function' => 'tripal_update_mview',
  786. '%new_function' => 'tripal_populate_mview',
  787. ]
  788. );
  789. //New API Function
  790. return tripal_populate_mview($mview_id);
  791. }
  792. /**
  793. * @deprecated Restructured API to make naming more readable and consistent.
  794. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  795. * now. This function is considered to be no easier to use than
  796. * tripal_get_mview_id directly tripal_get_mview_id().
  797. *
  798. * @see tripal_get_mview_id().
  799. */
  800. function tripal_mviews_get_mview_id($view_name) {
  801. tripal_report_error(
  802. 'tripal_deprecated', TRIPAL_NOTICE,
  803. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  804. [
  805. '%old_function' => 'tripal_mviews_get_mview_id',
  806. '%new_function' => 'tripal_get_mview_id',
  807. ]
  808. );
  809. //New API Function
  810. return tripal_get_mview_id($view_name);
  811. }
  812. /**
  813. * @deprecated Restructured API to make naming more readable and consistent.
  814. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  815. * now. This function is considered to be no easier to use than
  816. * chado_delete_record directly chado_delete_record().
  817. *
  818. * @see chado_delete_record().
  819. */
  820. function tripal_core_delete_property_by_id($basetable, $property_id) {
  821. tripal_report_error(
  822. 'tripal_deprecated',
  823. TRIPAL_NOTICE,
  824. "DEPRECATED: %old_function has been replaced with %new_function. This requires manual
  825. intervention since the arguments for the two functions are different.
  826. Please update your code.",
  827. [
  828. '%old_function' => 'tripal_core_delete_property_by_id',
  829. '%new_function' => 'chado_delete_record',
  830. ]
  831. );
  832. // construct the array that will match the exact record to update
  833. $match = [
  834. $basetable . 'prop_id' => $property_id,
  835. ];
  836. return chado_delete_record($basetable . 'prop', $match);
  837. }
  838. /**
  839. * @deprecated Restructured API to make naming more readable and consistent.
  840. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  841. * now. This function has been replaced by chado_delete_property().
  842. *
  843. * @see chado_delete_property().
  844. */
  845. function tripal_core_delete_property($basetable, $record_id, $property, $cv_name) {
  846. tripal_report_error(
  847. 'tripal_deprecated',
  848. TRIPAL_NOTICE,
  849. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  850. [
  851. '%old_function' => 'tripal_core_delete_property',
  852. '%new_function' => 'chado_delete_property',
  853. ]
  854. );
  855. $record = [
  856. 'table' => $basetable,
  857. 'id' => $record_id,
  858. ];
  859. $property = [
  860. 'type_name' => $property,
  861. 'cv_name' => $cv_name,
  862. ];
  863. //New API Function
  864. return chado_delete_property($record, $property);
  865. }
  866. /**
  867. * @deprecated Restructured API to make naming more readable and consistent.
  868. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  869. * now. This function has been replaced by chado_get_property().
  870. *
  871. * @see chado_get_property().
  872. */
  873. function tripal_core_get_property($basetable, $record_id, $property, $cv_name) {
  874. tripal_report_error(
  875. 'tripal_deprecated',
  876. TRIPAL_NOTICE,
  877. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  878. [
  879. '%old_function' => 'tripal_core_get_property',
  880. '%new_function' => 'chado_get_property',
  881. ]
  882. );
  883. $record = [
  884. 'table' => $basetable,
  885. 'id' => $record_id,
  886. ];
  887. $property = [
  888. 'type_name' => $property,
  889. 'cv_name' => $cv_name,
  890. ];
  891. //New API Function
  892. return chado_get_property($record, $property);
  893. }
  894. /**
  895. * @deprecated Restructured API to make naming more readable and consistent.
  896. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  897. * now. This function has been replaced by chado_get_table_max_rank().
  898. *
  899. * @see chado_get_table_max_rank().
  900. */
  901. function tripal_get_max_chado_rank($tablename, $where_options) {
  902. tripal_report_error(
  903. 'tripal_deprecated',
  904. TRIPAL_NOTICE,
  905. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  906. [
  907. '%old_function' => 'tripal_get_max_chado_rank',
  908. '%new_function' => 'chado_get_table_max_rank',
  909. ]
  910. );
  911. //New API Function
  912. return chado_get_table_max_rank($tablename, $where_options);
  913. }
  914. /**
  915. * @deprecated Restructured API to make naming more readable and consistent.
  916. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  917. * now. This function has been replaced by chado_get_table_max_rank().
  918. *
  919. * @see chado_get_table_max_rank().
  920. */
  921. function get_max_chado_rank($tablename, $where_options) {
  922. tripal_report_error(
  923. 'tripal_deprecated',
  924. TRIPAL_NOTICE,
  925. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  926. [
  927. '%old_function' => 'get_max_chado_rank',
  928. '%new_function' => 'chado_get_table_max_rank',
  929. ]
  930. );
  931. //New API Function
  932. return chado_get_table_max_rank($tablename, $where_options);
  933. }
  934. /**
  935. * @deprecated Restructured API to make naming more readable and consistent.
  936. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  937. * now. This function has been replaced by chado_insert_property().
  938. *
  939. * @see chado_insert_property().
  940. */
  941. function tripal_core_insert_property($basetable, $record_id, $property,
  942. $cv_name, $value, $update_if_present = 0) {
  943. tripal_report_error(
  944. 'tripal_deprecated',
  945. TRIPAL_NOTICE,
  946. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  947. [
  948. '%old_function' => 'tripal_core_insert_property',
  949. '%new_function' => 'chado_insert_property',
  950. ]
  951. );
  952. $record = [
  953. 'table' => $basetable,
  954. 'id' => $record_id,
  955. ];
  956. $property = [
  957. 'type_name' => $property,
  958. 'cv_name' => $cv_name,
  959. 'value' => $value,
  960. ];
  961. $options = [
  962. 'update_if_present' => $update_if_present,
  963. ];
  964. //New API Function
  965. return chado_insert_property($record, $property, $options);
  966. }
  967. /**
  968. * @deprecated Restructured API to make naming more readable and consistent.
  969. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  970. * now. This function has been replaced by chado_update_property().
  971. *
  972. * @see chado_update_property().
  973. */
  974. function tripal_core_update_property_by_id($basetable, $record_id, $property,
  975. $cv_name, $value) {
  976. tripal_report_error(
  977. 'tripal_deprecated',
  978. TRIPAL_NOTICE,
  979. "DEPRECATED: %old_function has been replaced with %new_function. This requires manual
  980. intervention since the arguments have changed. Please update your code.",
  981. [
  982. '%old_function' => 'tripal_core_update_property_by_id',
  983. '%new_function' => 'chado_update_property',
  984. ]
  985. );
  986. $record = [
  987. 'table' => $basetable,
  988. 'prop_id' => $record_id,
  989. ];
  990. $property = [
  991. 'type_name' => $property,
  992. 'cv_name' => $cv_name,
  993. 'value' => $value,
  994. ];
  995. // New API Function.
  996. return chado_update_property($record, $property);
  997. }
  998. /**
  999. * @deprecated Restructured API to make naming more readable and consistent.
  1000. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  1001. * now. This function has been replaced by chado_update_property().
  1002. *
  1003. * @see chado_update_property().
  1004. */
  1005. function tripal_core_update_property($basetable, $record_id, $property,
  1006. $cv_name, $value, $insert_if_missing = 0) {
  1007. tripal_report_error(
  1008. 'tripal_deprecated',
  1009. TRIPAL_NOTICE,
  1010. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  1011. [
  1012. '%old_function' => 'tripal_core_update_property',
  1013. '%new_function' => 'chado_update_property',
  1014. ]
  1015. );
  1016. $record = [
  1017. 'table' => $basetable,
  1018. 'id' => $record_id,
  1019. ];
  1020. $property = [
  1021. 'type_name' => $property,
  1022. 'cv_name' => $cv_name,
  1023. 'value' => $value,
  1024. ];
  1025. $options = [
  1026. 'insert_if_missing' => $insert_if_missing,
  1027. ];
  1028. // New API Function.
  1029. return chado_update_property($record, $property, $options);
  1030. }
  1031. /**
  1032. * @deprecated Restructured API to make naming more readable and consistent.
  1033. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  1034. * now. This function has been replaced by chado_create_custom_table().
  1035. *
  1036. * @see chado_create_custom_table().
  1037. */
  1038. function tripal_core_create_custom_table(&$ret, $table, $schema, $skip_creation = 1) {
  1039. tripal_report_error(
  1040. 'tripal_deprecated',
  1041. TRIPAL_NOTICE,
  1042. "DEPRECATED: %old_function has been replaced with %new_function. Note that $ret has
  1043. been removed from the paramters since this is not longer used in Drupal 7.
  1044. Please update your code.",
  1045. [
  1046. '%old_function' => 'tripal_core_create_custom_table',
  1047. '%new_function' => 'chado_create_custom_table',
  1048. ]
  1049. );
  1050. //New API Function
  1051. return chado_create_custom_table($table, $schema, $skip_creation);
  1052. }
  1053. /**
  1054. * @deprecated Restructured API to make naming more readable and consistent.
  1055. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  1056. * now. This function has been replaced by chado_edit_custom_table().
  1057. *
  1058. * @see chado_edit_custom_table().
  1059. */
  1060. function tripal_core_edit_custom_table($table_id, $table_name, $schema, $skip_creation = 1) {
  1061. tripal_report_error(
  1062. 'tripal_deprecated',
  1063. TRIPAL_NOTICE,
  1064. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  1065. [
  1066. '%old_function' => 'tripal_core_edit_custom_table',
  1067. '%new_function' => 'chado_edit_custom_table',
  1068. ]
  1069. );
  1070. //New API Function
  1071. return chado_edit_custom_table($table_id, $table_name, $schema, $skip_creation);
  1072. }
  1073. /**
  1074. * @deprecated Restructured API to make naming more readable and consistent.
  1075. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  1076. * now. This function has been replaced by chado_get_custom_table_id().
  1077. *
  1078. * @see chado_get_custom_table_id().
  1079. */
  1080. function tripal_custom_tables_get_table_id($table_name) {
  1081. tripal_report_error(
  1082. 'tripal_deprecated',
  1083. TRIPAL_NOTICE,
  1084. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  1085. [
  1086. '%old_function' => 'tripal_custom_tables_get_table_id',
  1087. '%new_function' => 'chado_get_custom_table_id',
  1088. ]
  1089. );
  1090. //New API Function
  1091. return chado_get_custom_table_id($table_name);
  1092. }
  1093. /**
  1094. * @deprecated Restructured API to make naming more readable and consistent.
  1095. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  1096. * now. This function has been replaced by chado_get_custom_table_schema().
  1097. *
  1098. * @see chado_get_custom_table_schema().
  1099. */
  1100. function tripal_get_chado_custom_schema($table) {
  1101. tripal_report_error(
  1102. 'tripal_deprecated',
  1103. TRIPAL_NOTICE,
  1104. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  1105. [
  1106. '%old_function' => 'tripal_get_chado_custom_schema',
  1107. '%new_function' => 'chado_get_custom_table_schema',
  1108. ]
  1109. );
  1110. //New API Function
  1111. return chado_get_custom_table_schema($table);
  1112. }
  1113. /**
  1114. * @deprecated Restructured API to make naming more readable and consistent.
  1115. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  1116. * now. This function has been replaced by chado_is_installed().
  1117. *
  1118. * @see chado_is_installed().
  1119. */
  1120. function tripal_core_is_chado_installed() {
  1121. tripal_report_error(
  1122. 'tripal_deprecated',
  1123. TRIPAL_NOTICE,
  1124. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  1125. [
  1126. '%old_function' => 'tripal_core_is_chado_installed',
  1127. '%new_function' => 'chado_is_installed',
  1128. ]
  1129. );
  1130. //New API Function
  1131. return chado_is_installed();
  1132. }
  1133. /**
  1134. * @deprecated Restructured API to make naming more readable and consistent.
  1135. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  1136. * now. This function has been replaced by chado_get_schema().
  1137. *
  1138. * @see chado_get_schema().
  1139. */
  1140. function tripal_core_get_chado_table_schema($table) {
  1141. tripal_report_error(
  1142. 'tripal_deprecated',
  1143. TRIPAL_NOTICE,
  1144. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  1145. [
  1146. '%old_function' => 'tripal_core_get_chado_table_schema',
  1147. '%new_function' => 'chado_get_schema',
  1148. ]
  1149. );
  1150. //New API Function
  1151. return chado_get_schema($table);
  1152. }
  1153. /**
  1154. * @deprecated Restructured API to make naming more readable and consistent.
  1155. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  1156. * now. This function has been replaced by chado_get_version().
  1157. *
  1158. * @see chado_get_version().
  1159. */
  1160. function tripal_core_get_chado_version($exact = FALSE, $warn_if_unsupported = FALSE) {
  1161. tripal_report_error(
  1162. 'tripal_deprecated',
  1163. TRIPAL_NOTICE,
  1164. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  1165. [
  1166. '%old_function' => 'tripal_core_get_chado_version',
  1167. '%new_function' => 'chado_get_version',
  1168. ]
  1169. );
  1170. //New API Function
  1171. return chado_get_version($exact, $warn_if_unsupported);
  1172. }
  1173. /**
  1174. * @deprecated Restructured API to make naming more readable and consistent.
  1175. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  1176. * now. This function has been replaced by chado_set_active().
  1177. *
  1178. * @see chado_set_active().
  1179. */
  1180. function tripal_db_set_active($dbname = 'default') {
  1181. tripal_report_error(
  1182. 'tripal_deprecated',
  1183. TRIPAL_NOTICE,
  1184. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  1185. [
  1186. '%old_function' => 'tripal_db_set_active',
  1187. '%new_function' => 'chado_set_active',
  1188. ]
  1189. );
  1190. //New API Function
  1191. return chado_set_active($dbname);
  1192. }
  1193. /**
  1194. * @deprecated Restructured API to make naming more readable and consistent.
  1195. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  1196. * now. This function has been replaced by chado_is_local().
  1197. *
  1198. * @see chado_is_local().
  1199. */
  1200. function tripal_core_is_chado_local() {
  1201. tripal_report_error(
  1202. 'tripal_deprecated',
  1203. TRIPAL_NOTICE,
  1204. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  1205. [
  1206. '%old_function' => 'tripal_core_is_chado_local',
  1207. '%new_function' => 'chado_is_local',
  1208. ]
  1209. );
  1210. //New API Function
  1211. return chado_is_local();
  1212. }
  1213. /**
  1214. * @deprecated Restructured API to make naming more readable and consistent.
  1215. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  1216. * now. This function has been replaced by chado_get_table_names().
  1217. *
  1218. * @see chado_get_table_names().
  1219. */
  1220. function tripal_core_get_chado_tables($include_custom = NULL) {
  1221. tripal_report_error(
  1222. 'tripal_deprecated',
  1223. TRIPAL_NOTICE,
  1224. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  1225. [
  1226. '%old_function' => 'tripal_core_get_chado_tables',
  1227. '%new_function' => 'chado_get_table_names',
  1228. ]
  1229. );
  1230. //New API Function
  1231. return chado_get_table_names($include_custom);
  1232. }
  1233. /**
  1234. * @deprecated Restructured API to make naming more readable and consistent.
  1235. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  1236. * now. This function has been replaced by chado_is_local().
  1237. *
  1238. * @see chado_is_local().
  1239. */
  1240. function tripal_core_chado_schema_exists() {
  1241. tripal_report_error(
  1242. 'tripal_deprecated',
  1243. TRIPAL_NOTICE,
  1244. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  1245. [
  1246. '%old_function' => 'tripal_core_chado_schema_exists',
  1247. '%new_function' => 'chado_is_local',
  1248. ]
  1249. );
  1250. //New API Function
  1251. return chado_is_local();
  1252. }
  1253. /**
  1254. * @deprecated Restructured API to make naming more readable and consistent.
  1255. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  1256. * now. This function has been replaced by chado_dbschema_exists().
  1257. *
  1258. * @see chado_dbschema_exists().
  1259. */
  1260. function tripal_core_schema_exists($schema) {
  1261. tripal_report_error(
  1262. 'tripal_deprecated',
  1263. TRIPAL_NOTICE,
  1264. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  1265. [
  1266. '%old_function' => 'tripal_core_schema_exists',
  1267. '%new_function' => 'chado_dbschema_exists',
  1268. ]
  1269. );
  1270. //New API Function
  1271. return chado_dbschema_exists($schema);
  1272. }
  1273. /**
  1274. * @deprecated Restructured API to make naming more readable and consistent.
  1275. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  1276. * now. This function has been replaced by tripal_set_admin_message().
  1277. *
  1278. * @see tripal_set_admin_message().
  1279. *
  1280. * function theme_tripal_admin_message($variables) {
  1281. * tripal_report_error(
  1282. * 'tripal_deprecated',
  1283. * TRIPAL_NOTICE,
  1284. * "DEPRECATED: %old_function has been replaced with %new_function. Please
  1285. * update your code.", array(
  1286. * '%old_function'=>'chado_get_id_for_node',
  1287. * '%new_function' => 'chado_get_id_from_nid'
  1288. * )
  1289. * );
  1290. *
  1291. * //New API Function
  1292. * return tripal_set_admin_message();
  1293. * }
  1294. */
  1295. /**
  1296. * @deprecated Restructured API to make naming more readable and consistent.
  1297. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  1298. * now. This function has been replaced by tripal_report_error().
  1299. *
  1300. * @see tripal_report_error().
  1301. * @todo Remove. This was not in Tripal 1.x.
  1302. */
  1303. function tripal_core_report_error($type, $severity, $message, $variables = [], $options = []) {
  1304. tripal_report_error(
  1305. 'tripal_deprecated',
  1306. TRIPAL_NOTICE,
  1307. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  1308. [
  1309. '%old_function' => 'tripal_core_report_error',
  1310. '%new_function' => 'tripal_report_error',
  1311. ]
  1312. );
  1313. //New API Function
  1314. return tripal_report_error($type, $severity, $message, $variables, $options);
  1315. }