1 | <?php |
||
11 | trait ValuePart { |
||
12 | |||
13 | /** @var mixed */ |
||
14 | private $value; |
||
15 | |||
16 | /** @var bool */ |
||
17 | private $hasValue = false; |
||
18 | |||
19 | /** @var string */ |
||
20 | private $expression; |
||
21 | |||
22 | /** @var bool */ |
||
23 | private $hasExpression = false; |
||
24 | |||
25 | /** |
||
26 | * @deprecated use `setValue()` instead |
||
27 | * @param mixed $value |
||
28 | * @return $this |
||
29 | */ |
||
30 | 3 | public function setDefaultValue($value) { |
|
33 | |||
34 | /** |
||
35 | * @deprecated use `unsetValue()` instead |
||
36 | * @return $this |
||
37 | */ |
||
38 | public function unsetDefaultValue() { |
||
41 | |||
42 | /** |
||
43 | * @deprecated use `getValue()` instead |
||
44 | * @return mixed |
||
45 | */ |
||
46 | 4 | public function getDefaultValue() { |
|
49 | |||
50 | /** |
||
51 | * @deprecated use `hasValue()` instead |
||
52 | * @return bool |
||
53 | */ |
||
54 | 2 | public function hasDefaultValue() { |
|
57 | |||
58 | /** |
||
59 | * Sets the value |
||
60 | * |
||
61 | * @param mixed $value |
||
62 | * @return $this |
||
63 | */ |
||
64 | 21 | public function setValue($value) { |
|
70 | |||
71 | /** |
||
72 | * Unsets the value |
||
73 | * |
||
74 | * @return $this |
||
75 | */ |
||
76 | 1 | public function unsetValue() { |
|
82 | |||
83 | /** |
||
84 | * Returns the value |
||
85 | * |
||
86 | * @return mixed |
||
87 | */ |
||
88 | 12 | public function getValue() { |
|
91 | |||
92 | /** |
||
93 | * Checks whether a value or expression is set |
||
94 | * |
||
95 | * @return bool |
||
96 | */ |
||
97 | 20 | public function hasValue() { |
|
100 | |||
101 | /** |
||
102 | * Returns whether an expression is set |
||
103 | * |
||
104 | * @return bool |
||
105 | */ |
||
106 | 5 | public function isExpression() { |
|
109 | |||
110 | /** |
||
111 | * Sets an expression |
||
112 | * |
||
113 | * @param string $expr |
||
114 | * @return $this |
||
115 | */ |
||
116 | 3 | public function setExpression($expr) { |
|
122 | |||
123 | /** |
||
124 | * Returns the expression |
||
125 | * |
||
126 | * @return string |
||
127 | */ |
||
128 | 2 | public function getExpression() { |
|
131 | |||
132 | /** |
||
133 | * Unsets the expression |
||
134 | * |
||
135 | * @return $this |
||
136 | */ |
||
137 | 1 | public function unsetExpression() { |
|
143 | } |
||
144 |