1 | <?php |
||
50 | class SystemProperties extends AbstractProperties |
||
51 | { |
||
52 | /** |
||
53 | * Object ID |
||
54 | * |
||
55 | * @var Id |
||
56 | */ |
||
57 | protected $_id = 0; |
||
58 | |||
59 | /** |
||
60 | * Object type |
||
61 | * |
||
62 | * @var Type |
||
63 | */ |
||
64 | protected $_type = null; |
||
65 | |||
66 | /** |
||
67 | * Object revision |
||
68 | * |
||
69 | * @var Revision |
||
70 | */ |
||
71 | protected $_revision = null; |
||
72 | |||
73 | /** |
||
74 | * Creation date |
||
75 | * |
||
76 | * @var \DateTimeImmutable |
||
77 | */ |
||
78 | protected $_created = null; |
||
79 | |||
80 | /** |
||
81 | * Publication date |
||
82 | * |
||
83 | * @var \DateTimeImmutable |
||
84 | */ |
||
85 | protected $_published = null; |
||
86 | |||
87 | /** |
||
88 | * Object hash |
||
89 | * |
||
90 | * @var string |
||
91 | */ |
||
92 | protected $_hash = null; |
||
93 | |||
94 | /** |
||
95 | * Collection name |
||
96 | * |
||
97 | * @var string |
||
98 | */ |
||
99 | const COLLECTION = 'system'; |
||
100 | |||
101 | /******************************************************************************* |
||
102 | * PUBLIC METHODS |
||
103 | *******************************************************************************/ |
||
104 | |||
105 | /** |
||
106 | * System properties constructor |
||
107 | * |
||
108 | * @param array $data Property data |
||
109 | * @param ObjectInterface $object Owner object |
||
110 | */ |
||
111 | 2 | public function __construct(array $data, ObjectInterface $object) |
|
145 | |||
146 | /** |
||
147 | * Return the object ID |
||
148 | * |
||
149 | * @return Id Object ID |
||
150 | */ |
||
151 | public function getId() |
||
155 | |||
156 | /** |
||
157 | * Return the object type |
||
158 | * |
||
159 | * @return Type Object type |
||
160 | */ |
||
161 | public function getType() |
||
165 | |||
166 | /** |
||
167 | * Return the object revision |
||
168 | * |
||
169 | * @return Revision Object revision |
||
170 | */ |
||
171 | public function getRevision() |
||
175 | |||
176 | /** |
||
177 | * Return the creation date & time |
||
178 | * |
||
179 | * @return \DateTimeImmutable Creation date & time |
||
180 | */ |
||
181 | public function getCreated() |
||
185 | |||
186 | /** |
||
187 | * Return the publication date & time |
||
188 | * |
||
189 | * @return \DateTimeImmutable Publication date & time |
||
190 | */ |
||
191 | public function getPublished() |
||
195 | |||
196 | /** |
||
197 | * Return the object hash |
||
198 | * |
||
199 | * @return string Object hash |
||
200 | */ |
||
201 | public function getHash() |
||
205 | |||
206 | /******************************************************************************* |
||
207 | * PRIVATE METHODS |
||
208 | *******************************************************************************/ |
||
209 | |||
210 | /** |
||
211 | * Set the object ID |
||
212 | * |
||
213 | * @param Id $id |
||
214 | */ |
||
215 | 1 | protected function _setId(Id $id) |
|
219 | |||
220 | /** |
||
221 | * Set the object type |
||
222 | * |
||
223 | * @param Type $type Object type |
||
224 | */ |
||
225 | 1 | protected function _setType(Type $type) |
|
229 | |||
230 | /** |
||
231 | * Set the object revision |
||
232 | * |
||
233 | * @param Revision $revision Object revision |
||
234 | */ |
||
235 | 1 | protected function _setRevision(Revision $revision) |
|
239 | |||
240 | /** |
||
241 | * Set the publication date & time |
||
242 | * |
||
243 | * @param \DateTimeImmutable $published Publication date & time |
||
244 | */ |
||
245 | 1 | protected function _setPublished(\DateTimeImmutable $published) |
|
249 | |||
250 | /** |
||
251 | * Set the creation date & time |
||
252 | * |
||
253 | * @param \DateTimeImmutable $published Creation date & time |
||
254 | */ |
||
255 | protected function _setCreated(\DateTimeImmutable $created) |
||
259 | |||
260 | /** |
||
261 | * Set the object hash |
||
262 | * |
||
263 | * @param string $hash Object hash |
||
264 | */ |
||
265 | protected function _setHash($hash) |
||
269 | } |
||
270 |