tripal_project.DEPRECATED.inc

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

Wrapper functions to provide backwards compatibility for the tripal project api

File

tripal_project/api/tripal_project.DEPRECATED.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Wrapper functions to provide backwards compatibility for the tripal project 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_project_get_property($project_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_project_get_property',
  20. '%new_function' => 'chado_get_property'
  21. )
  22. );
  23. $record = array(
  24. 'table' => 'project',
  25. 'id' => $project_id,
  26. );
  27. $property = array(
  28. 'type_name' => $property,
  29. 'cv_name' => 'project_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_project_insert_property($project_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_project_insert_property',
  47. '%new_function' => 'chado_insert_property'
  48. )
  49. );
  50. $record = array(
  51. 'table' => 'project',
  52. 'id' => $project_id,
  53. );
  54. $property = array(
  55. 'type_name' => $property,
  56. 'cv_name' => 'project_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_project_update_property($project_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_project_update_property',
  78. '%new_function' => 'chado_update_property'
  79. )
  80. );
  81. $record = array(
  82. 'table' => 'project',
  83. 'id' => $project_id,
  84. );
  85. $property = array(
  86. 'type_name' => $property,
  87. 'cv_name' => 'project_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_project_delete_property($project_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_project_delete_property',
  109. '%new_function' => 'chado_delete_property'
  110. )
  111. );
  112. $record = array(
  113. 'table' => 'project',
  114. 'id' => $project_id,
  115. );
  116. $property = array(
  117. 'type_name' => $property,
  118. 'cv_name' => 'project_property',
  119. );
  120. return chado_delete_property($record, $property);
  121. }