tripal.DEPRECATED.api.inc

These api functions are deprecated, if your site is currently using them please update your code with the newer tripal.jobs.api functions.

File

tripal/api/tripal.DEPRECATED.api.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. *
  5. * These api functions are deprecated, if your site is currently using them
  6. * please update your code with the newer tripal.jobs.api functions.
  7. */
  8. /**
  9. * @defgroup tripal_DEPRECATED_jobs_api Data Collections
  10. * @ingroup tripal_api
  11. * @{
  12. * Deprecated legacy api code from Tripal 2. Please see tripal.jobs.api.inc
  13. * for the new Tripal 3 functions.
  14. * @}
  15. */
  16. /**
  17. * DEPRECATED
  18. *
  19. * Returns the end time for a given job
  20. *
  21. * @param $job
  22. * An object describing the job
  23. *
  24. * @return
  25. * The end time of the job if it was already run and empty otherwise
  26. *
  27. * @ingroup tripal_DEPRECATED_jobs_api
  28. */
  29. function tripal_get_job_end($job) {
  30. tripal_report_error('tripal_deprecated', TRIPAL_NOTICE,
  31. "DEPRECATED: %function has been removed from the API the end date " .
  32. "is now accessible via the %property property. Please update your code.",
  33. array(
  34. '%old_function' => 'tripal_jobs_get_end_time',
  35. '%property' => '\$job->end_time_string',
  36. )
  37. );
  38. if ($job->end_time > 0) {
  39. $end = format_date($job->end_time);
  40. }
  41. else {
  42. $end = '';
  43. }
  44. return $end;
  45. }
  46. /**
  47. * DEPRECATED
  48. *
  49. * Returns the start time for a given job
  50. *
  51. * @param $job
  52. * An object describing the job
  53. *
  54. * @return
  55. * The start time of the job if it was already run and either "Cancelled" or "Not Yet Started" otherwise
  56. *
  57. * @ingroup tripal_DEPRECATED_jobs_api
  58. */
  59. function tripal_get_job_start($job) {
  60. tripal_report_error('tripal_deprecated', TRIPAL_NOTICE,
  61. "DEPRECATED: %function has been removed from the API the end date " .
  62. "is now accessible via the %property property. Please update your code.",
  63. array(
  64. '%old_function' => 'tripal_get_job_start',
  65. '%property' => '\$job->start_time_string',
  66. )
  67. );
  68. if ($job->start_time > 0) {
  69. $start = format_date($job->start_time);
  70. }
  71. else {
  72. if (strcmp($job->job_status, 'Cancelled')==0) {
  73. $start = 'Cancelled';
  74. }
  75. else {
  76. $start = 'Not Yet Started';
  77. }
  78. }
  79. return $start;
  80. }
  81. /**
  82. * DEPRECATED
  83. *
  84. * Returns the date the job was added to the queue
  85. *
  86. * @param $job
  87. * An object describing the job
  88. *
  89. * @return
  90. * The date the job was submitted
  91. *
  92. * @ingroup tripal_DEPRECATED_jobs_api
  93. */
  94. function tripal_get_job_submit_date($job) {
  95. tripal_report_error('tripal_deprecated', TRIPAL_NOTICE,
  96. "DEPRECATED: %function has been removed from the API the end date " .
  97. "is now accessible via the %property property. Please update your code.",
  98. array(
  99. '%old_function' => 'tripal_get_job_submit_date',
  100. '%property' => '\$job->submit_date_string',
  101. )
  102. );
  103. return format_date($job->submit_date);
  104. }