PageRenderTime 51ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/classes/scheduler/TimeBlock.inc.php

https://github.com/lib-uoguelph-ca/ocs
PHP | 140 lines | 48 code | 17 blank | 75 comment | 2 complexity | 6c15cb7c1c3ec109a3ee172c77896c4b MD5 | raw file
Possible License(s): GPL-2.0
  1. <?php
  2. /**
  3. * @file classes/scheduler/TimeBlock.inc.php
  4. *
  5. * Copyright (c) 2000-2012 John Willinsky
  6. * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
  7. *
  8. * @package scheduler
  9. * @class TimeBlock
  10. *
  11. * TimeBlock class.
  12. * Basic class describing a block of time available for scheduling.
  13. *
  14. * $Id$
  15. */
  16. class TimeBlock extends DataObject {
  17. //
  18. // Get/set methods
  19. //
  20. /**
  21. * Get the ID of the timeBlock.
  22. * @return int
  23. */
  24. function getTimeBlockId() {
  25. if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
  26. return $this->getId();
  27. }
  28. /**
  29. * Set the ID of the timeBlock.
  30. * @param $timeBlockId int
  31. */
  32. function setTimeBlockId($timeBlockId) {
  33. if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
  34. return $this->setId($timeBlockId);
  35. }
  36. /**
  37. * Get the sched conf ID of the timeBlock.
  38. * @return int
  39. */
  40. function getSchedConfId() {
  41. return $this->getData('schedConfId');
  42. }
  43. /**
  44. * Set the sched conf ID of the timeBlock.
  45. * @param $schedConfId int
  46. */
  47. function setSchedConfId($schedConfId) {
  48. return $this->setData('schedConfId', $schedConfId);
  49. }
  50. /**
  51. * Get the start time of the timeBlock.
  52. * @return string
  53. */
  54. function getStartTime() {
  55. return $this->getData('startTime');
  56. }
  57. /**
  58. * Set the start time of the timeBlock.
  59. * @param $startTime string
  60. */
  61. function setStartTime($startTime) {
  62. return $this->setData('startTime', $startTime);
  63. }
  64. /**
  65. * Get the end time of the timeBlock.
  66. * @return string
  67. */
  68. function getEndTime() {
  69. return $this->getData('endTime');
  70. }
  71. /**
  72. * Set the end time of the timeBlock.
  73. * @param $endTime string
  74. */
  75. function setEndTime($endTime) {
  76. return $this->setData('endTime', $endTime);
  77. }
  78. /**
  79. * Get the name of the time block.
  80. * @param $locale string
  81. * @return string
  82. */
  83. function getName($locale) {
  84. return $this->getData('name', $locale);
  85. }
  86. /**
  87. * Set the name of the time block.
  88. * @param $name string
  89. * @param $locale string
  90. */
  91. function setName($name, $locale) {
  92. return $this->setData('name', $name, $locale);
  93. }
  94. /**
  95. * Get the colour of this time block for use when it has been assigned to a presentation or special event.
  96. * @return string
  97. */
  98. function getAssignedColour() {
  99. return $this->getData('assignedColour');
  100. }
  101. /**
  102. * Set the colour of this time block for use when it has been assigned to a presentation or special event.
  103. * @param $assignedColour string
  104. */
  105. function setAssignedColour($assignedColour) {
  106. return $this->setData('assignedColour', $assignedColour);
  107. }
  108. /**
  109. * Get the colour of this time block for use when it has not been assigned to a presentation or special event.
  110. * @return string
  111. */
  112. function getUnassignedColour() {
  113. return $this->getData('unassignedColour');
  114. }
  115. /**
  116. * Set the colour of this time block for use when it has not been assigned to a presentation or special event.
  117. * @param $unassignedColour string
  118. */
  119. function setUnassignedColour($unassignedColour) {
  120. return $this->setData('unassignedColour', $unassignedColour);
  121. }
  122. }
  123. ?>