tripal_library.DEPRECATED.inc 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?php
  2. /**
  3. * @file
  4. * Wrapper functions to provide backwards compatibility for the tripal library 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_property().
  10. *
  11. * @see chado_get_property().
  12. */
  13. function tripal_library_get_property($library_id, $property) {
  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_library_get_property',
  20. '%new_function' => 'chado_get_property'
  21. )
  22. );
  23. $record = array(
  24. 'table' => 'library',
  25. 'id' => $library_id,
  26. );
  27. $property = array(
  28. 'type_name' => $property,
  29. 'cv_name' => 'library_property'
  30. );
  31. return chado_get_property($record, $property);
  32. }
  33. /**
  34. * @deprecated Restructured API to make naming more readable and consistent.
  35. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  36. * This function has been replaced by chado_insert_property().
  37. *
  38. * @see chado_insert_property().
  39. */
  40. function tripal_library_insert_property($library_id, $property, $value, $update_if_present = 0) {
  41. tripal_report_error(
  42. 'tripal_deprecated',
  43. TRIPAL_NOTICE,
  44. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  45. array(
  46. '%old_function'=>'tripal_library_insert_property',
  47. '%new_function' => 'chado_insert_property'
  48. )
  49. );
  50. $record = array(
  51. 'table' => 'library',
  52. 'id' => $library_id,
  53. );
  54. $property = array(
  55. 'type_name' => $property,
  56. 'cv_name' => 'library_property',
  57. 'value' => $value,
  58. );
  59. $options = array(
  60. 'update_if_present' => $update_if_present,
  61. );
  62. return chado_insert_property($record, $property, $options);
  63. }
  64. /**
  65. * @deprecated Restructured API to make naming more readable and consistent.
  66. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  67. * This function has been replaced by chado_update_property().
  68. *
  69. * @see chado_update_property().
  70. */
  71. function tripal_library_update_property($library_id, $property, $value, $insert_if_missing = 0) {
  72. tripal_report_error(
  73. 'tripal_deprecated',
  74. TRIPAL_NOTICE,
  75. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  76. array(
  77. '%old_function'=>'tripal_library_update_property',
  78. '%new_function' => 'chado_update_property'
  79. )
  80. );
  81. $record = array(
  82. 'table' => 'library',
  83. 'id' => $library_id,
  84. );
  85. $property = array(
  86. 'type_name' => $property,
  87. 'cv_name' => 'library_property',
  88. 'value' => $value,
  89. );
  90. $options = array(
  91. 'insert_if_missing' => $insert_if_missing,
  92. );
  93. return chado_update_property($record, $property, $options);
  94. }
  95. /**
  96. * @deprecated Restructured API to make naming more readable and consistent.
  97. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  98. * This function has been replaced by chado_delete_property().
  99. *
  100. * @see chado_delete_property().
  101. */
  102. function tripal_library_delete_property($library_id, $property) {
  103. tripal_report_error(
  104. 'tripal_deprecated',
  105. TRIPAL_NOTICE,
  106. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  107. array(
  108. '%old_function'=>'tripal_library_delete_property',
  109. '%new_function' => 'chado_delete_property'
  110. )
  111. );
  112. $record = array(
  113. 'table' => 'library',
  114. 'id' => $library_id,
  115. );
  116. $property = array(
  117. 'type_name' => $property,
  118. 'cv_name' => 'library_property',
  119. );
  120. return chado_delete_property($record, $property);
  121. }