tripal_analysis.DEPRECATED.inc 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <?php
  2. /**
  3. * @file
  4. * Wrapper functions to provide backwards compatibility for the tripal analysis
  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_register_analysis_child().
  11. *
  12. * @see tripal_register_analysis_child().
  13. */
  14. function tripal_analysis_register_child($modulename) {
  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_analysis_register_child',
  21. '%new_function' => 'tripal_register_analysis_child',
  22. ]
  23. );
  24. return tripal_register_analysis_child($modulename);
  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
  30. * tripal_unregister_analysis_child().
  31. *
  32. * @see tripal_unregister_analysis_child().
  33. */
  34. function tripal_analysis_unregister_child($modulename) {
  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' => 'tripal_analysis_unregister_child',
  41. '%new_function' => 'tripal_unregister_analysis_child',
  42. ]
  43. );
  44. return tripal_unregister_analysis_child($modulename);
  45. }
  46. /**
  47. * @deprecated Restructured API to make naming more readable and consistent.
  48. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  49. * now. This function has been replaced by chado_get_property().
  50. *
  51. * @see chado_get_property().
  52. */
  53. function tripal_analysis_get_property($analysis_id, $property, $cv_name = 'tripal') {
  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_analysis_get_property',
  60. '%new_function' => 'chado_get_property',
  61. ]
  62. );
  63. $record = [
  64. 'table' => 'analysis',
  65. 'id' => $analysis_id,
  66. ];
  67. $property = [
  68. 'type_name' => $property,
  69. 'cv_name' => $cv_name,
  70. ];
  71. return chado_get_property($record, $property);
  72. }
  73. /**
  74. * @deprecated Restructured API to make naming more readable and consistent.
  75. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  76. * now. This function has been replaced by chado_insert_property().
  77. *
  78. * @see chado_insert_property().
  79. */
  80. function tripal_analysis_insert_property($analysis_id, $property, $value, $update_if_present = 0, $cv_name = 'tripal') {
  81. tripal_report_error(
  82. 'tripal_deprecated',
  83. TRIPAL_NOTICE,
  84. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  85. [
  86. '%old_function' => 'tripal_analysis_insert_property',
  87. '%new_function' => 'chado_insert_property',
  88. ]
  89. );
  90. $record = [
  91. 'table' => 'analysis',
  92. 'id' => $analysis_id,
  93. ];
  94. $property = [
  95. 'type_name' => $property,
  96. 'cv_name' => $cv_name,
  97. 'value' => $value,
  98. ];
  99. $options = [
  100. 'update_if_present' => $update_if_present,
  101. ];
  102. return chado_insert_property($record, $property, $options);
  103. }
  104. /**
  105. * @deprecated Restructured API to make naming more readable and consistent.
  106. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  107. * now. This function has been replaced by chado_update_property().
  108. *
  109. * @see chado_update_property().
  110. */
  111. function tripal_analysis_update_property($analysis_id, $property, $value, $insert_if_missing = 0, $cv_name = 'tripal') {
  112. tripal_report_error(
  113. 'tripal_deprecated',
  114. TRIPAL_NOTICE,
  115. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  116. [
  117. '%old_function' => 'tripal_analysis_update_property',
  118. '%new_function' => 'chado_update_property',
  119. ]
  120. );
  121. $record = [
  122. 'table' => 'analysis',
  123. 'id' => $analysis_id,
  124. ];
  125. $property = [
  126. 'type_name' => $property,
  127. 'cv_name' => $cv_name,
  128. 'value' => $value,
  129. ];
  130. $options = [
  131. 'insert_if_missing' => $insert_if_missing,
  132. ];
  133. return chado_update_property($record, $property, $options);
  134. }
  135. /**
  136. * @deprecated Restructured API to make naming more readable and consistent.
  137. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  138. * now. This function has been replaced by the more generic
  139. * chado_delete_property().
  140. *
  141. * @see chado_delete_property().
  142. */
  143. function tripal_analysis_delete_property($analysis_id, $property, $cv_name = 'tripal') {
  144. tripal_report_error('tripal_deprecated', TRIPAL_NOTICE,
  145. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  146. [
  147. '%old_function' => 'tripal_analysis_delete_property',
  148. '%new_function' => 'chado_delete_property',
  149. ]
  150. );
  151. $record = [
  152. 'table' => 'analysis',
  153. 'id' => $analysis_id,
  154. ];
  155. $property = [
  156. 'type_name' => $property,
  157. 'cv_name' => $cv_name,
  158. ];
  159. return chado_delete_property($record, $property);
  160. }
  161. /**
  162. * @deprecated Restructured API to make naming more readable and consistent.
  163. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from
  164. * now. This function has been replaced by tripal_get_analysis().
  165. *
  166. * @see tripal_get_analysis().
  167. */
  168. function tripal_analysis_get_node($analysis_id) {
  169. tripal_report_error(
  170. 'tripal_deprecated',
  171. TRIPAL_NOTICE,
  172. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  173. [
  174. '%old_function' => 'tripal_analysis_get_node',
  175. '%new_function' => 'tripal_get_analysis',
  176. ]
  177. );
  178. return tripal_get_analysis(['analysis_id' => $analysis_id]);
  179. }