tripal_analysis.DEPRECATED.inc

  1. 2.x tripal_analysis/api/tripal_analysis.DEPRECATED.inc
  2. 3.x legacy/tripal_analysis/api/tripal_analysis.DEPRECATED.inc

Wrapper functions to provide backwards compatibility for the tripal analysis api

File

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