[TASK] Deprecate the $icon setter/getter in the Extbase Category model
[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 /**
18 * This model represents a category (for anything).
19 *
20 * @api
21 */
22 class Category extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
23 {
24 /**
25 * @var string
26 * @validate notEmpty
27 */
28 protected $title = '';
29
30 /**
31 * @var string
32 */
33 protected $description = '';
34
35 /**
36 * @var string
37 */
38 protected $icon = '';
39
40 /**
41 * @var \TYPO3\CMS\Extbase\Domain\Model\Category|NULL
42 * @lazy
43 */
44 protected $parent = null;
45
46 /**
47 * Gets the title.
48 *
49 * @return string the title, might be empty
50 * @api
51 */
52 public function getTitle()
53 {
54 return $this->title;
55 }
56
57 /**
58 * Sets the title.
59 *
60 * @param string $title the title to set, may be empty
61 * @return void
62 * @api
63 */
64 public function setTitle($title)
65 {
66 $this->title = $title;
67 }
68
69 /**
70 * Gets the description.
71 *
72 * @return string the description, might be empty
73 * @api
74 */
75 public function getDescription()
76 {
77 return $this->description;
78 }
79
80 /**
81 * Sets the description.
82 *
83 * @param string $description the description to set, may be empty
84 * @return void
85 * @api
86 */
87 public function setDescription($description)
88 {
89 $this->description = $description;
90 }
91
92 /**
93 * Returns the icon
94 *
95 * @return string $icon
96 * @deprecated since TYPO3 v8, will be removed in TYPO3 v9
97 */
98 public function getIcon()
99 {
100 \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction();
101 return $this->icon;
102 }
103
104 /**
105 * Sets the icon
106 *
107 * @param string $icon
108 * @return void
109 * @deprecated since TYPO3 v8, will be removed in TYPO3 v9
110 */
111 public function setIcon($icon)
112 {
113 \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction();
114 $this->icon = $icon;
115 }
116
117 /**
118 * Gets the parent category.
119 *
120 * @return \TYPO3\CMS\Extbase\Domain\Model\Category|NULL the parent category
121 * @api
122 */
123 public function getParent()
124 {
125 if ($this->parent instanceof \TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy) {
126 $this->parent->_loadRealInstance();
127 }
128 return $this->parent;
129 }
130
131 /**
132 * Sets the parent category.
133 *
134 * @param \TYPO3\CMS\Extbase\Domain\Model\Category $parent the parent category
135 * @return void
136 * @api
137 */
138 public function setParent(\TYPO3\CMS\Extbase\Domain\Model\Category $parent)
139 {
140 $this->parent = $parent;
141 }
142 }