tripal_organism.DEPRECATED.inc 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. /**
  3. * @file
  4. * Wrapper functions to provide backwards compatibility for the tripal organism
  5. * api
  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 tripal_get_organism().
  11. *
  12. * @see tripal_get_organism().
  13. */
  14. function tripal_organism_get_organism_by_nid($nid) {
  15. tripal_report_error(
  16. 'tripal_deprecated',
  17. TRIPAL_NOTICE,
  18. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  19. [
  20. '%old_function' => 'tripal_organism_get_organism_by_nid',
  21. '%new_function' => 'tripal_get_organism',
  22. ]
  23. );
  24. return tripal_get_organism(['nid' => $nid]);
  25. }
  26. /**
  27. * @deprecated Restructured API to make naming more readable and consistent.
  28. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  29. * now. This function has been replaced by tripal_get_organism().
  30. *
  31. * @see tripal_get_organism().
  32. */
  33. function tripal_organism_get_organism_by_organism_id($organism_id) {
  34. tripal_report_error(
  35. 'tripal_deprecated',
  36. TRIPAL_NOTICE,
  37. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  38. [
  39. '%old_function' => 'tripal_organism_get_organism_by_organism_id',
  40. '%new_function' => 'tripal_get_organism',
  41. ]
  42. );
  43. return tripal_get_organism(['organism_id' => $organism_id]);
  44. }
  45. /**
  46. * @deprecated Restructured API to make naming more readable and consistent.
  47. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  48. * now. This function has been replaced by
  49. * tripal_get_organism_select_options().
  50. *
  51. * @see tripal_get_organism_select_options().
  52. */
  53. function tripal_organism_get_synced() {
  54. tripal_report_error(
  55. 'tripal_deprecated',
  56. TRIPAL_NOTICE,
  57. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  58. [
  59. '%old_function' => 'tripal_organism_get_synced',
  60. '%new_function' => 'tripal_get_organism_select_options',
  61. ]
  62. );
  63. return tripal_get_organism_select_options();
  64. }
  65. /**
  66. * @deprecated Restructured API to make naming more readable and consistent.
  67. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  68. * now. This function has been replaced by tripal_get_organism_image().
  69. *
  70. * @see tripal_get_organism_image().
  71. */
  72. function tripal_organism_get_image_url($organism, $nid = NULL) {
  73. tripal_report_error(
  74. 'tripal_deprecated',
  75. TRIPAL_NOTICE,
  76. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  77. [
  78. '%old_function' => 'tripal_organism_get_image_url',
  79. '%new_function' => 'tripal_get_organism_image',
  80. ]
  81. );
  82. return tripal_get_organism_image_url($organism);
  83. }