tripal_contact.DEPRECATED.inc 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <?php
  2. /**
  3. * @file
  4. * Wrapper functions to provide backwards compatibility for the tripal contact 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_contact_get_property($contact_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_contact_get_property',
  20. '%new_function' => 'chado_get_property'
  21. )
  22. );
  23. return chado_get_property('contact', $contact_id, $property, 'tripal_contact');;
  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 chado_insert_property().
  29. *
  30. * @see chado_insert_property().
  31. */
  32. function tripal_contact_insert_property($contact_id, $property, $value, $update_if_present = 0) {
  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_contact_insert_property',
  39. '%new_function' => 'chado_insert_property'
  40. )
  41. );
  42. return chado_insert_property('contact', $contact_id, $property, 'tripal_contact', $value, $update_if_present);
  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_update_property().
  48. *
  49. * @see chado_update_property().
  50. */
  51. function tripal_contact_update_property($contact_id, $property, $value, $insert_if_missing = 0) {
  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_contact_update_property',
  58. '%new_function' => 'chado_update_property'
  59. )
  60. );
  61. return chado_update_property('contact', $contact_id, $property, 'tripal_contact', $value, $insert_if_missing);
  62. }
  63. /**
  64. * @deprecated Restructured API to make naming more readable and consistent.
  65. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  66. * This function has been replaced by chado_delete_property().
  67. *
  68. * @see chado_delete_property().
  69. */
  70. function tripal_contact_delete_property($contact_id, $property) {
  71. tripal_report_error(
  72. 'tripal_deprecated',
  73. TRIPAL_NOTICE,
  74. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  75. array(
  76. '%old_function'=>'tripal_contact_delete_property',
  77. '%new_function' => 'chado_delete_property'
  78. )
  79. );
  80. return chado_delete_property('contact', $contact_id, $property, 'tripal_contact');
  81. }
  82. /**
  83. * @deprecated Restructured API to make naming more readable and consistent.
  84. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  85. * This function has been replaced by contact_insert().
  86. *
  87. * @see contact_insert().
  88. */
  89. function tripal_contact_add_contact($name, $description, $type, $properties) {
  90. tripal_report_error(
  91. 'tripal_deprecated',
  92. TRIPAL_NOTICE,
  93. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  94. array(
  95. '%old_function'=>'tripal_contact_add_contact',
  96. '%new_function' => 'contact_insert'
  97. )
  98. );
  99. return contact_insert(array(
  100. 'name' => $name,
  101. 'description' => $description,
  102. 'type_name' => $type,
  103. 'properties' => $properties
  104. ));
  105. }