PageRenderTime 64ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/classes/scheduler/Building.inc.php

https://github.com/lib-uoguelph-ca/ocs
PHP | 136 lines | 45 code | 17 blank | 74 comment | 2 complexity | 9377a18c1b603ed409e665c74644d1c0 MD5 | raw file
Possible License(s): GPL-2.0
  1. <?php
  2. /**
  3. * @file Building.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. * @class Building
  9. * @ingroup scheduler
  10. * @see BuildingDAO
  11. *
  12. * @brief Basic class describing a building.
  13. */
  14. //$Id$
  15. class Building extends DataObject {
  16. //
  17. // Get/set methods
  18. //
  19. /**
  20. * Get the ID of the building.
  21. * @return int
  22. */
  23. function getBuildingId() {
  24. if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
  25. return $this->getId();
  26. }
  27. /**
  28. * Set the ID of the building.
  29. * @param $buildingId int
  30. */
  31. function setBuildingId($buildingId) {
  32. if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
  33. return $this->setId($buildingId);
  34. }
  35. /**
  36. * Get the sched conf ID of the building.
  37. * @return int
  38. */
  39. function getSchedConfId() {
  40. return $this->getData('schedConfId');
  41. }
  42. /**
  43. * Set the sched conf ID of the building.
  44. * @param $schedConfId int
  45. */
  46. function setSchedConfId($schedConfId) {
  47. return $this->setData('schedConfId', $schedConfId);
  48. }
  49. /**
  50. * Get the localized name of the building.
  51. * @return string
  52. */
  53. function getBuildingName() {
  54. return $this->getLocalizedData('name');
  55. }
  56. /**
  57. * Get the name of the building.
  58. * @param $locale string
  59. * @return string
  60. */
  61. function getName($locale) {
  62. return $this->getData('name', $locale);
  63. }
  64. /**
  65. * Set the name of the building.
  66. * @param $name string
  67. * @param $locale string
  68. */
  69. function setName($name, $locale) {
  70. return $this->setData('name', $name, $locale);
  71. }
  72. /**
  73. * Get the localized abbreviation of the building.
  74. * @return string
  75. */
  76. function getBuildingAbbrev() {
  77. return $this->getLocalizedData('abbrev');
  78. }
  79. /**
  80. * Get the abbreviation of the building.
  81. * @param $locale string
  82. * @return string
  83. */
  84. function getAbbrev($locale) {
  85. return $this->getData('abbrev', $locale);
  86. }
  87. /**
  88. * Set the abbreviation of the building.
  89. * @param $abbrev string
  90. * @param $locale string
  91. */
  92. function setAbbrev($abbrev, $locale) {
  93. return $this->setData('abbrev', $abbrev, $locale);
  94. }
  95. /**
  96. * Get the localized description of the building.
  97. * @return string
  98. */
  99. function getBuildingDescription() {
  100. return $this->getLocalizedData('description');
  101. }
  102. /**
  103. * Get the description of the building.
  104. * @param $locale string
  105. * @return string
  106. */
  107. function getDescription($locale) {
  108. return $this->getData('description', $locale);
  109. }
  110. /**
  111. * Set the description of the building.
  112. * @param $description string
  113. * @param $locale string
  114. */
  115. function setDescription($description, $locale) {
  116. return $this->setData('description', $description, $locale);
  117. }
  118. }
  119. ?>