1 | <?php |
||
47 | abstract class AbstractProperties implements PropertiesInterface |
||
48 | { |
||
49 | /** |
||
50 | * Property data |
||
51 | * |
||
52 | * @var array |
||
53 | */ |
||
54 | protected $data = []; |
||
55 | /** |
||
56 | * Owner object |
||
57 | * |
||
58 | * @var ObjectInterface |
||
59 | */ |
||
60 | protected $object = null; |
||
61 | |||
62 | /** |
||
63 | * Meta properties constructor |
||
64 | * |
||
65 | * @param array $data Property data |
||
66 | * @param ObjectInterface $object Owner object |
||
67 | */ |
||
68 | 23 | public function __construct(array $data, ObjectInterface $object) |
|
73 | |||
74 | /** |
||
75 | * Return the owner object |
||
76 | * |
||
77 | * @return ObjectInterface Owner object |
||
78 | */ |
||
79 | public function getObject() |
||
80 | { |
||
81 | return $this->object; |
||
82 | } |
||
83 | |||
84 | /** |
||
85 | * Normalize and sort a property value list |
||
86 | * |
||
87 | * @param array $values Property values |
||
88 | * @return array Normalized and sorted property values |
||
89 | */ |
||
90 | 19 | protected function normalizeSortedPropertyValues(array $values) |
|
96 | |||
97 | /** |
||
98 | * Mutate a string property |
||
99 | * |
||
100 | * @param string $property Property name |
||
101 | * @param string $value New value |
||
102 | * @return $this|AbstractProperties Self reference or clone |
||
103 | */ |
||
104 | 1 | protected function mutateStringProperty($property, $value) |
|
117 | |||
118 | /** |
||
119 | * Mutate a float property |
||
120 | * |
||
121 | * @param string $property Property name |
||
122 | * @param float $value New value |
||
123 | * @return $this|AbstractProperties Self reference or clone |
||
124 | */ |
||
125 | 1 | protected function mutateFloatProperty($property, $value) |
|
138 | |||
139 | /** |
||
140 | * Mutate a list property |
||
141 | * |
||
142 | * @param string $property Property name |
||
143 | * @param array $values New values |
||
144 | * @return $this|AbstractProperties Self reference or clone |
||
145 | */ |
||
146 | 1 | protected function mutateListProperty($property, array $values) |
|
158 | |||
159 | /** |
||
160 | * Mutate a neste properties property |
||
161 | * |
||
162 | * @param string $property Property name |
||
163 | * @param PropertiesInterface $value Nested properties |
||
164 | * @return $this|AbstractProperties Self reference or clone |
||
165 | */ |
||
166 | 1 | protected function mutatePropertiesProperty($property, PropertiesInterface $value) |
|
178 | } |
||
179 |