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

/lib/pkp/classes/reviewForm/ReviewForm.inc.php

https://github.com/lib-uoguelph-ca/ocs
PHP | 213 lines | 77 code | 29 blank | 107 comment | 4 complexity | 6e5eaf8241609f42cbdaff8051ce99a4 MD5 | raw file
Possible License(s): GPL-2.0
  1. <?php
  2. /**
  3. * @defgroup reviewForm
  4. */
  5. /**
  6. * @file classes/reviewForm/ReviewForm.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 ReviewForm
  12. * @ingroup reviewForm
  13. * @see ReviewerFormDAO
  14. *
  15. * @brief Basic class describing a review form.
  16. *
  17. */
  18. class ReviewForm extends DataObject {
  19. /**
  20. * Constructor.
  21. */
  22. function ReviewForm() {
  23. parent::DataObject();
  24. }
  25. /**
  26. * Get localized title.
  27. * @return string
  28. */
  29. function getLocalizedTitle() {
  30. return $this->getLocalizedData('title');
  31. }
  32. /**
  33. * Get localized description.
  34. * @return string
  35. */
  36. function getLocalizedDescription() {
  37. return $this->getLocalizedData('description');
  38. }
  39. //
  40. // Get/set methods
  41. //
  42. /**
  43. * Get the number of completed reviews for this review form.
  44. * @return int
  45. */
  46. function getCompleteCount() {
  47. return $this->getData('completeCount');
  48. }
  49. /**
  50. * Set the number of complete reviews for this review form.
  51. * @param $completeCount int
  52. */
  53. function setCompleteCount($completeCount) {
  54. return $this->setData('completeCount', $completeCount);
  55. }
  56. /**
  57. * Get the number of incomplete reviews for this review form.
  58. * @return int
  59. */
  60. function getIncompleteCount() {
  61. return $this->getData('incompleteCount');
  62. }
  63. /**
  64. * Set the number of incomplete reviews for this review form.
  65. * @param $incompleteCount int
  66. */
  67. function setIncompleteCount($incompleteCount) {
  68. return $this->setData('incompleteCount', $incompleteCount);
  69. }
  70. /**
  71. * Get the associated type.
  72. * @return int
  73. */
  74. function getAssocType() {
  75. return $this->getData('assocType');
  76. }
  77. /**
  78. * Set the associated type.
  79. * @param $assocType int
  80. */
  81. function setAssocType($assocType) {
  82. return $this->setData('assocType', $assocType);
  83. }
  84. /**
  85. * Get the Id of the associated type.
  86. * @return int
  87. */
  88. function getAssocId() {
  89. return $this->getData('assocId');
  90. }
  91. /**
  92. * Set the Id of the associated type.
  93. * @param $assocId int
  94. */
  95. function setAssocId($assocId) {
  96. return $this->setData('assocId', $assocId);
  97. }
  98. /**
  99. * Get sequence of review form.
  100. * @return float
  101. */
  102. function getSequence() {
  103. return $this->getData('sequence');
  104. }
  105. /**
  106. * Set sequence of review form.
  107. * @param $sequence float
  108. */
  109. function setSequence($sequence) {
  110. return $this->setData('sequence', $sequence);
  111. }
  112. /**
  113. * Get active flag
  114. * @return int
  115. */
  116. function getActive() {
  117. return $this->getData('active');
  118. }
  119. /**
  120. * Set active flag
  121. * @param $active int
  122. */
  123. function setActive($active) {
  124. return $this->setData('active', $active);
  125. }
  126. /**
  127. * Get title.
  128. * @param $locale string
  129. * @return string
  130. */
  131. function getTitle($locale) {
  132. return $this->getData('title', $locale);
  133. }
  134. /**
  135. * Set title.
  136. * @param $title string
  137. * @param $locale string
  138. */
  139. function setTitle($title, $locale) {
  140. return $this->setData('title', $title, $locale);
  141. }
  142. /**
  143. * Get description.
  144. * @param $locale string
  145. * @return string
  146. */
  147. function getDescription($locale) {
  148. return $this->getData('description', $locale);
  149. }
  150. /**
  151. * Set description.
  152. * @param $description string
  153. * @param $locale string
  154. */
  155. function setDescription($description, $locale) {
  156. return $this->setData('description', $description, $locale);
  157. }
  158. /** DEPRECATED **/
  159. function getReviewFormTitle() {
  160. if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
  161. return $this->getLocalizedTitle();
  162. }
  163. function getReviewFormDescription() {
  164. if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
  165. return $this->getLocalizedDescription();
  166. }
  167. /**
  168. * Get the ID of the review form.
  169. * @return int
  170. */
  171. function getReviewFormId() {
  172. if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
  173. return $this->getId();
  174. }
  175. /**
  176. * Set the ID of the review form.
  177. * @param $reviewFormId int
  178. */
  179. function setReviewFormId($reviewFormId) {
  180. if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
  181. return $this->setId($reviewFormId);
  182. }
  183. }
  184. ?>