Guest User

Untitled

a guest
Mar 21st, 2013
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.40 KB | None | 0 0
  1. <?php
  2. namespace TEST\MyMegamenu\Domain\Model;
  3.  
  4. /**
  5. *
  6. *
  7. * @package My_megamenu
  8. * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
  9. *
  10. */
  11. class Page extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
  12.  
  13. /**
  14. * uid
  15. * @var int
  16. * @validate NotEmpty
  17. */
  18. protected $uid;
  19.  
  20. /**
  21. * pid
  22. * @var int
  23. * @validate NotEmpty
  24. */
  25. protected $pid;
  26.  
  27. /**
  28. * sorting
  29. * @var int
  30. * @validate NotEmpty
  31. */
  32. protected $sorting;
  33.  
  34. /**
  35. * title
  36. * @var string
  37. *
  38. */
  39. protected $title;
  40.  
  41. /**
  42. * subtitle
  43. * @var string
  44. *
  45. */
  46. protected $subtitle;
  47.  
  48. /**
  49. * subpages
  50. *
  51. * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TEST\MyMegamenu\Domain\Model\Page>
  52. */
  53. protected $subpages;
  54.  
  55.  
  56. /**
  57. * __construct
  58. *
  59. * @return Page
  60. */
  61. public function __construct() {
  62. //Do not remove the next line: It would break the functionality
  63. $this->initStorageObjects();
  64. }
  65.  
  66. /**
  67. * Initializes all ObjectStorage properties.
  68. *
  69. * @return void
  70. */
  71. protected function initStorageObjects() {
  72. /**
  73. * Do not modify this method!
  74. * It will be rewritten on each save in the extension builder
  75. * You may modify the constructor of this class instead
  76. */
  77. $this->subpages = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
  78. }
  79.  
  80. /**
  81. * Returns the pid
  82. *
  83. * @return int $pid
  84. */
  85. public function getPid() {
  86. return $this->pid;
  87. }
  88.  
  89. /**
  90. * Returns the sorting
  91. *
  92. * @return int $sorting
  93. */
  94. public function getSorting() {
  95. return $this->sorting;
  96. }
  97.  
  98. /**
  99. * Returns the title
  100. *
  101. * @return string $title
  102. */
  103. public function getTitle() {
  104. return $this->title;
  105. }
  106.  
  107. /**
  108. * Returns the subtitle
  109. *
  110. * @return string $subtitle
  111. */
  112. public function getSubtitle() {
  113. return $this->subtitle;
  114. }
  115.  
  116. /**
  117. * menuimage
  118. *
  119. * @var \string
  120. */
  121. protected $menuimage;
  122.  
  123. /**
  124. * Returns the menuimage
  125. *
  126. * @return \string $menuimage
  127. */
  128. public function getMenuimage() {
  129. return $this->menuimage;
  130. }
  131.  
  132. /**
  133. * Sets the menuimage
  134. *
  135. * @param \string $menuimage
  136. * @return void
  137. */
  138. public function setMenuimage($menuimage) {
  139. $this->menuimage = $menuimage;
  140. }
  141.  
  142. /**
  143. * Adds a Page
  144. *
  145. * @param \TEST\MyMegamenu\Domain\Model\Page $subpage
  146. * @return void
  147. */
  148. public function addSubpage(\TEST\MyMegamenu\Domain\Model\Page $subpage) {
  149. $this->subpages->attach($subpage);
  150. }
  151.  
  152. /**
  153. * Removes a Page
  154. *
  155. * @param \TEST\MyMegamenu\Domain\Model\Page $subpageToRemove The Page to be removed
  156. * @return void
  157. */
  158. public function removeSubpage(\TEST\MyMegamenu\Domain\Model\Page $subpageToRemove) {
  159. $this->subpages->detach($subpageToRemove);
  160. }
  161.  
  162. /**
  163. * Returns the subpages
  164. *
  165. * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TEST\MyMegamenu\Domain\Model\Page> $subpages
  166. */
  167. public function getSubpages() {
  168. return $this->subpages;
  169. }
  170.  
  171. /**
  172. * Sets the subpages
  173. *
  174. * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TEST\MyMegamenu\Domain\Model\Page> $subpages
  175. * @return void
  176. */
  177. public function setSubpages(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $subpages) {
  178. $this->subpages = $subpages;
  179. }
  180. }
  181. ?>
Advertisement
Add Comment
Please, Sign In to add comment