[TASK] Streamline phpdoc annotations in EXT:extbase
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Domain / Model / Category.php
1 <?php
2 namespace TYPO3\CMS\Extbase\Domain\Model;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use TYPO3\CMS\Extbase\Annotation as Extbase;
18
19 /**
20 * This model represents a category (for anything).
21 */
22 class Category extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
23 {
24 /**
25 * @var string
26 * @Extbase\Validate("NotEmpty")
27 */
28 protected $title = '';
29
30 /**
31 * @var string
32 */
33 protected $description = '';
34
35 /**
36 * @var \TYPO3\CMS\Extbase\Domain\Model\Category|null
37 * @Extbase\ORM\Lazy
38 */
39 protected $parent;
40
41 /**
42 * Gets the title.
43 *
44 * @return string the title, might be empty
45 */
46 public function getTitle()
47 {
48 return $this->title;
49 }
50
51 /**
52 * Sets the title.
53 *
54 * @param string $title the title to set, may be empty
55 */
56 public function setTitle($title)
57 {
58 $this->title = $title;
59 }
60
61 /**
62 * Gets the description.
63 *
64 * @return string the description, might be empty
65 */
66 public function getDescription()
67 {
68 return $this->description;
69 }
70
71 /**
72 * Sets the description.
73 *
74 * @param string $description the description to set, may be empty
75 */
76 public function setDescription($description)
77 {
78 $this->description = $description;
79 }
80
81 /**
82 * Gets the parent category.
83 *
84 * @return \TYPO3\CMS\Extbase\Domain\Model\Category|null the parent category
85 */
86 public function getParent()
87 {
88 if ($this->parent instanceof \TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy) {
89 $this->parent->_loadRealInstance();
90 }
91 return $this->parent;
92 }
93
94 /**
95 * Sets the parent category.
96 *
97 * @param \TYPO3\CMS\Extbase\Domain\Model\Category $parent the parent category
98 */
99 public function setParent(\TYPO3\CMS\Extbase\Domain\Model\Category $parent)
100 {
101 $this->parent = $parent;
102 }
103 }