Apply PSR-12 code style (#3886)
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / system / label / object / type / LabelObjectType.class.php
1 <?php
2
3 namespace wcf\system\label\object\type;
4
5 /**
6 * Label object type.
7 *
8 * @author Alexander Ebert
9 * @copyright 2001-2019 WoltLab GmbH
10 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
11 * @package WoltLabSuite\Core\System\Label\Object\Type
12 */
13 class LabelObjectType
14 {
15 /**
16 * indentation level
17 * @var int
18 */
19 public $depth = 0;
20
21 /**
22 * object type is a category
23 * @var bool
24 */
25 public $isCategory = false;
26
27 /**
28 * object type label
29 * @var string
30 */
31 public $label = '';
32
33 /**
34 * object id
35 * @var int
36 */
37 public $objectID = 0;
38
39 /**
40 * option value
41 * @var int
42 */
43 public $optionValue = 0;
44
45 /**
46 * Creates a new LabelObjectType object.
47 *
48 * @param string $label
49 * @param int $objectID
50 * @param int $depth
51 * @param bool $isCategory
52 */
53 public function __construct($label, $objectID = 0, $depth = 0, $isCategory = false)
54 {
55 $this->depth = $depth;
56 $this->isCategory = $isCategory;
57 $this->label = $label;
58 $this->objectID = $objectID;
59 }
60
61 /**
62 * Returns the label.
63 *
64 * @return string
65 */
66 public function getLabel()
67 {
68 return $this->label;
69 }
70
71 /**
72 * Returns the object id.
73 * @return int
74 */
75 public function getObjectID()
76 {
77 return $this->objectID;
78 }
79
80 /**
81 * Returns true, if object type is a category.
82 *
83 * @return bool
84 */
85 public function isCategory()
86 {
87 return $this->isCategory;
88 }
89
90 /**
91 * Returns indentation level.
92 *
93 * @return int
94 */
95 public function getDepth()
96 {
97 return $this->depth;
98 }
99
100 /**
101 * Sets option value.
102 *
103 * @param int $optionValue
104 */
105 public function setOptionValue($optionValue)
106 {
107 $this->optionValue = $optionValue;
108 }
109
110 /**
111 * Returns option value.
112 *
113 * @return int
114 */
115 public function getOptionValue()
116 {
117 return $this->optionValue;
118 }
119 }