PageRenderTime 46ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/pkp/classes/announcement/PKPAnnouncementType.inc.php

https://github.com/lib-uoguelph-ca/ocs
PHP | 104 lines | 37 code | 14 blank | 53 comment | 3 complexity | 18f64723f517bf559581840fc41bd504 MD5 | raw file
Possible License(s): GPL-2.0
  1. <?php
  2. /**
  3. * @file PKPAnnouncementType.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 PKPAnnouncementType
  9. * @ingroup announcement
  10. * @see AnnouncementTypeDAO, AnnouncementTypeForm, PKPAnnouncementTypeDAO, PKPAnnouncementTypeForm
  11. *
  12. * @brief Basic class describing an announcement type.
  13. */
  14. class PKPAnnouncementType extends DataObject {
  15. //
  16. // Get/set methods
  17. //
  18. /**
  19. * Get the ID of the announcement type.
  20. * @return int
  21. */
  22. function getTypeId() {
  23. if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
  24. return $this->getId();
  25. }
  26. /**
  27. * Set the ID of the announcement type.
  28. * @param $typeId int
  29. */
  30. function setTypeId($typeId) {
  31. if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
  32. return $this->setId($typeId);
  33. }
  34. /**
  35. * Get assoc ID for this annoucement.
  36. * @return int
  37. */
  38. function getAssocId() {
  39. return $this->getData('assocId');
  40. }
  41. /**
  42. * Set assoc ID for this annoucement.
  43. * @param $assocId int
  44. */
  45. function setAssocId($assocId) {
  46. return $this->setData('assocId', $assocId);
  47. }
  48. /**
  49. * Get assoc type for this annoucement.
  50. * @return int
  51. */
  52. function getAssocType() {
  53. return $this->getData('assocType');
  54. }
  55. /**
  56. * Set assoc Type for this annoucement.
  57. * @param $assocType int
  58. */
  59. function setAssocType($assocType) {
  60. return $this->setData('assocType', $assocType);
  61. }
  62. /**
  63. * Get the type of the announcement type.
  64. * @return string
  65. */
  66. function getLocalizedTypeName() {
  67. return $this->getLocalizedData('name');
  68. }
  69. function getAnnouncementTypeName() {
  70. if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
  71. return $this->getLocalizedTypeName();
  72. }
  73. /**
  74. * Get the type of the announcement type.
  75. * @param $locale string
  76. * @return string
  77. */
  78. function getName($locale) {
  79. return $this->getData('name', $locale);
  80. }
  81. /**
  82. * Set the type of the announcement type.
  83. * @param $name string
  84. * @param $locale string
  85. */
  86. function setName($name, $locale) {
  87. return $this->setData('name', $name, $locale);
  88. }
  89. }
  90. ?>