PageRenderTime 33ms CodeModel.GetById 10ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/pkp/classes/group/Group.inc.php

https://github.com/lib-uoguelph-ca/ocs
PHP | 160 lines | 57 code | 23 blank | 80 comment | 3 complexity | 3d778637bfcb3a26d7a4e6b291ce6edf MD5 | raw file
Possible License(s): GPL-2.0
  1. <?php
  2. /**
  3. * @defgroup group
  4. */
  5. /**
  6. * @file classes/group/Group.inc.php
  7. *
  8. * Copyright (c) 2000-2012 John Willinsky
  9. * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
  10. *
  11. * @class Group
  12. * @ingroup group
  13. * @see GroupDAO
  14. *
  15. * @brief Describes user groups.
  16. */
  17. // $Id$
  18. define('GROUP_CONTEXT_EDITORIAL_TEAM', 0x000001);
  19. define('GROUP_CONTEXT_PEOPLE', 0x000002);
  20. class Group extends DataObject {
  21. /**
  22. * Get localized title of group.
  23. */
  24. function getLocalizedTitle() {
  25. return $this->getLocalizedData('title');
  26. }
  27. function getGroupTitle() {
  28. if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
  29. return $this->getLocalizedTitle();
  30. }
  31. //
  32. // Get/set methods
  33. //
  34. /**
  35. * Get title of group (primary locale)
  36. * @param $locale string
  37. * @return string
  38. */
  39. function getTitle($locale) {
  40. return $this->getData('title', $locale);
  41. }
  42. /**
  43. * Set title of group
  44. * @param $title string
  45. * @param $locale string
  46. */
  47. function setTitle($title, $locale) {
  48. return $this->setData('title', $title, $locale);
  49. }
  50. /**
  51. * Get context of group
  52. * @return int
  53. */
  54. function getContext() {
  55. return $this->getData('context');
  56. }
  57. /**
  58. * Set context of group
  59. * @param $context int
  60. */
  61. function setContext($context) {
  62. return $this->setData('context',$context);
  63. }
  64. /**
  65. * Get flag indicating whether or not the group is displayed in "About"
  66. * @return boolean
  67. */
  68. function getAboutDisplayed() {
  69. return $this->getData('aboutDisplayed');
  70. }
  71. /**
  72. * Set flag indicating whether or not the group is displayed in "About"
  73. * @param $aboutDisplayed boolean
  74. */
  75. function setAboutDisplayed($aboutDisplayed) {
  76. return $this->setData('aboutDisplayed',$aboutDisplayed);
  77. }
  78. /**
  79. * Get ID of group. Deprecated in favour of getId.
  80. * @return int
  81. */
  82. function getGroupId() {
  83. if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
  84. return $this->getId();
  85. }
  86. /**
  87. * Set ID of group. DEPRECATED in favour of setId.
  88. * @param $groupId int
  89. */
  90. function setGroupId($groupId) {
  91. if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
  92. return $this->setId($groupId);
  93. }
  94. /**
  95. * Get assoc ID for this group.
  96. * @return int
  97. */
  98. function getAssocId() {
  99. return $this->getData('assocId');
  100. }
  101. /**
  102. * Set assoc ID for this group.
  103. * @param $assocId int
  104. */
  105. function setAssocId($assocId) {
  106. return $this->setData('assocId', $assocId);
  107. }
  108. /**
  109. * Get assoc type for this group.
  110. * @return int
  111. */
  112. function getAssocType() {
  113. return $this->getData('assocType');
  114. }
  115. /**
  116. * Set assoc type for this group.
  117. * @param $assocType int
  118. */
  119. function setAssocType($assocType) {
  120. return $this->setData('assocType', $assocType);
  121. }
  122. /**
  123. * Get sequence of group.
  124. * @return float
  125. */
  126. function getSequence() {
  127. return $this->getData('sequence');
  128. }
  129. /**
  130. * Set sequence of group.
  131. * @param $sequence float
  132. */
  133. function setSequence($sequence) {
  134. return $this->setData('sequence', $sequence);
  135. }
  136. }
  137. ?>