Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace GOG\Blog\Domain\Model;
- /***
- *
- * This file is part of the "Blog" Extension for TYPO3 CMS.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * (c) 2019
- *
- ***/
- /**
- * Blog
- */
- class Tag extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
- {
- /**
- * Tag title
- *
- * @var string
- */
- protected $title = '';
- /**
- * children
- *
- * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<Tag>
- */
- protected $subTags = null;
- public function __construct()
- {
- //Do not remove the next line: It would break the functionality
- $this->initStorageObjects();
- }
- /**
- * Initializes all ObjectStorage properties
- * Do not modify this method!
- * It will be rewritten on each save in the extension builder
- * You may modify the constructor of this class instead
- *
- * @return void
- */
- protected function initStorageObjects()
- {
- $this->subTags = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
- }
- /**
- * @param $title string
- */
- public function setTitle($title)
- {
- $this->title = $title;
- }
- /**
- * @return string
- */
- public function getTitle() {
- return $this->title;
- }
- /**
- * Adds a Tag
- *
- * @param Tag $tag
- * @return void
- */
- public function addSubTag(Tag $tag)
- {
- $this->subTags->attach($tag);
- }
- /**
- * Removes a Tag
- *
- * @param Tag $tag
- * @return void
- */
- public function removeSubTag(Tag $tag)
- {
- $this->subTags->detach($tag);
- }
- /**
- * Returns the Tags
- *
- * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<Tag> $subTags
- */
- public function getSubTags()
- {
- return $this->subTags;
- }
- /**
- * Sets the Tags
- *
- * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<Tag> $tags
- * @return void
- */
- public function setSubTags(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $tags)
- {
- $this->subTags = $tags;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement