|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* WebHemi. |
|
4
|
|
|
* |
|
5
|
|
|
* PHP version 7.1 |
|
6
|
|
|
* |
|
7
|
|
|
* @copyright 2012 - 2018 Gixx-web (http://www.gixx-web.com) |
|
8
|
|
|
* @license https://opensource.org/licenses/MIT The MIT License (MIT) |
|
9
|
|
|
* |
|
10
|
|
|
* @link http://www.gixx-web.com |
|
11
|
|
|
*/ |
|
12
|
|
|
declare(strict_types = 1); |
|
13
|
|
|
|
|
14
|
|
|
namespace WebHemi\Data\Entity; |
|
15
|
|
|
|
|
16
|
|
|
use WebHemi\DateTime; |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* Class FilesystemPublishedDocumentEntity |
|
20
|
|
|
*/ |
|
21
|
|
|
class FilesystemPublishedDocumentEntity extends AbstractEntity |
|
22
|
|
|
{ |
|
23
|
|
|
/** |
|
24
|
|
|
* @var array |
|
25
|
|
|
*/ |
|
26
|
|
|
protected $container = [ |
|
27
|
|
|
'id_filesystem' => null, |
|
28
|
|
|
'id_filesystem_document' => null, |
|
29
|
|
|
'fk_application' => null, |
|
30
|
|
|
'fk_category' => null, |
|
31
|
|
|
'fk_author' => null, |
|
32
|
|
|
'path' => null, |
|
33
|
|
|
'basename' => null, |
|
34
|
|
|
'uri' => null, |
|
35
|
|
|
'title' => null, |
|
36
|
|
|
'description' => null, |
|
37
|
|
|
'content_lead' => null, |
|
38
|
|
|
'content_body' => null, |
|
39
|
|
|
'date_published' => null, |
|
40
|
|
|
]; |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* @param int $identifier |
|
44
|
|
|
* @return FilesystemPublishedDocumentEntity |
|
45
|
|
|
*/ |
|
46
|
|
|
public function setFilesystemId(int $identifier) : FilesystemPublishedDocumentEntity |
|
47
|
|
|
{ |
|
48
|
|
|
$this->container['id_filesystem'] = $identifier; |
|
49
|
|
|
|
|
50
|
|
|
return $this; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* @return int|null |
|
55
|
|
|
*/ |
|
56
|
|
|
public function getFilesystemId() : ? int |
|
57
|
|
|
{ |
|
58
|
|
|
return !is_null($this->container['id_filesystem']) |
|
59
|
|
|
? (int) $this->container['id_filesystem'] |
|
60
|
|
|
: null; |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* @param int $identifier |
|
65
|
|
|
* @return FilesystemPublishedDocumentEntity |
|
66
|
|
|
*/ |
|
67
|
|
|
public function setFilesystemDocumentId(int $identifier) : FilesystemPublishedDocumentEntity |
|
68
|
|
|
{ |
|
69
|
|
|
$this->container['id_filesystem_document'] = $identifier; |
|
70
|
|
|
|
|
71
|
|
|
return $this; |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
/** |
|
75
|
|
|
* @return int|null |
|
76
|
|
|
*/ |
|
77
|
|
|
public function getFilesystemDocumentId() : ? int |
|
78
|
|
|
{ |
|
79
|
|
|
return !is_null($this->container['id_filesystem_document']) |
|
80
|
|
|
? (int) $this->container['id_filesystem_document'] |
|
81
|
|
|
: null; |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
/** |
|
85
|
|
|
* @param int $applicationIdentifier |
|
86
|
|
|
* @return FilesystemPublishedDocumentEntity |
|
87
|
|
|
*/ |
|
88
|
|
|
public function setApplicationId(int $applicationIdentifier) : FilesystemPublishedDocumentEntity |
|
89
|
|
|
{ |
|
90
|
|
|
$this->container['fk_application'] = $applicationIdentifier; |
|
91
|
|
|
|
|
92
|
|
|
return $this; |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
/** |
|
96
|
|
|
* @return int|null |
|
97
|
|
|
*/ |
|
98
|
|
|
public function getApplicationId() : ? int |
|
99
|
|
|
{ |
|
100
|
|
|
return !is_null($this->container['fk_application']) |
|
101
|
|
|
? (int) $this->container['fk_application'] |
|
102
|
|
|
: null; |
|
103
|
|
|
} |
|
104
|
|
|
|
|
105
|
|
|
/** |
|
106
|
|
|
* @param int $categoryIdentifier |
|
107
|
|
|
* @return FilesystemPublishedDocumentEntity |
|
108
|
|
|
*/ |
|
109
|
|
|
public function setCategoryId(int $categoryIdentifier) : FilesystemPublishedDocumentEntity |
|
110
|
|
|
{ |
|
111
|
|
|
$this->container['fk_category'] = $categoryIdentifier; |
|
112
|
|
|
|
|
113
|
|
|
return $this; |
|
114
|
|
|
} |
|
115
|
|
|
|
|
116
|
|
|
/** |
|
117
|
|
|
* @return int|null |
|
118
|
|
|
*/ |
|
119
|
|
|
public function getCategoryId() : ? int |
|
120
|
|
|
{ |
|
121
|
|
|
return !is_null($this->container['fk_category']) |
|
122
|
|
|
? (int) $this->container['fk_category'] |
|
123
|
|
|
: null; |
|
124
|
|
|
} |
|
125
|
|
|
|
|
126
|
|
|
/** |
|
127
|
|
|
* @param int $authorIdentifier |
|
128
|
|
|
* @return FilesystemPublishedDocumentEntity |
|
129
|
|
|
*/ |
|
130
|
|
|
public function setAuthorId(int $authorIdentifier) : FilesystemPublishedDocumentEntity |
|
131
|
|
|
{ |
|
132
|
|
|
$this->container['fk_author'] = $authorIdentifier; |
|
133
|
|
|
|
|
134
|
|
|
return $this; |
|
135
|
|
|
} |
|
136
|
|
|
|
|
137
|
|
|
/** |
|
138
|
|
|
* @return int|null |
|
139
|
|
|
*/ |
|
140
|
|
|
public function getAuthorId() : ? int |
|
141
|
|
|
{ |
|
142
|
|
|
return !is_null($this->container['fk_author']) |
|
143
|
|
|
? (int) $this->container['fk_author'] |
|
144
|
|
|
: null; |
|
145
|
|
|
} |
|
146
|
|
|
|
|
147
|
|
|
/** |
|
148
|
|
|
* @param string $path |
|
149
|
|
|
* @return FilesystemPublishedDocumentEntity |
|
150
|
|
|
*/ |
|
151
|
|
|
public function setPath(string $path) : FilesystemPublishedDocumentEntity |
|
152
|
|
|
{ |
|
153
|
|
|
$this->container['path'] = $path; |
|
154
|
|
|
|
|
155
|
|
|
return $this; |
|
156
|
|
|
} |
|
157
|
|
|
|
|
158
|
|
|
/** |
|
159
|
|
|
* @return null|string |
|
160
|
|
|
*/ |
|
161
|
|
|
public function getPath() : ? string |
|
162
|
|
|
{ |
|
163
|
|
|
return $this->container['path']; |
|
164
|
|
|
} |
|
165
|
|
|
|
|
166
|
|
|
/** |
|
167
|
|
|
* @param string $baseName |
|
168
|
|
|
* @return FilesystemPublishedDocumentEntity |
|
169
|
|
|
*/ |
|
170
|
|
|
public function setBaseName(string $baseName) : FilesystemPublishedDocumentEntity |
|
171
|
|
|
{ |
|
172
|
|
|
$this->container['basename'] = $baseName; |
|
173
|
|
|
|
|
174
|
|
|
return $this; |
|
175
|
|
|
} |
|
176
|
|
|
|
|
177
|
|
|
/** |
|
178
|
|
|
* @return null|string |
|
179
|
|
|
*/ |
|
180
|
|
|
public function getBaseName() : ? string |
|
181
|
|
|
{ |
|
182
|
|
|
return $this->container['basename']; |
|
183
|
|
|
} |
|
184
|
|
|
|
|
185
|
|
|
/** |
|
186
|
|
|
* @param string $uri |
|
187
|
|
|
* @return FilesystemPublishedDocumentEntity |
|
188
|
|
|
*/ |
|
189
|
|
|
public function setUri(string $uri) : FilesystemPublishedDocumentEntity |
|
190
|
|
|
{ |
|
191
|
|
|
$this->container['uri'] = $uri; |
|
192
|
|
|
|
|
193
|
|
|
return $this; |
|
194
|
|
|
} |
|
195
|
|
|
|
|
196
|
|
|
/** |
|
197
|
|
|
* @return null|string |
|
198
|
|
|
*/ |
|
199
|
|
|
public function getUri() : ? string |
|
200
|
|
|
{ |
|
201
|
|
|
return $this->container['uri']; |
|
202
|
|
|
} |
|
203
|
|
|
|
|
204
|
|
|
/** |
|
205
|
|
|
* @param string $title |
|
206
|
|
|
* @return FilesystemPublishedDocumentEntity |
|
207
|
|
|
*/ |
|
208
|
|
|
public function setTitle(string $title) : FilesystemPublishedDocumentEntity |
|
209
|
|
|
{ |
|
210
|
|
|
$this->container['title'] = $title; |
|
211
|
|
|
|
|
212
|
|
|
return $this; |
|
213
|
|
|
} |
|
214
|
|
|
|
|
215
|
|
|
/** |
|
216
|
|
|
* @return null|string |
|
217
|
|
|
*/ |
|
218
|
|
|
public function getTitle() : ? string |
|
219
|
|
|
{ |
|
220
|
|
|
return $this->container['title']; |
|
221
|
|
|
} |
|
222
|
|
|
|
|
223
|
|
|
/** |
|
224
|
|
|
* @param string $description |
|
225
|
|
|
* @return FilesystemPublishedDocumentEntity |
|
226
|
|
|
*/ |
|
227
|
|
|
public function setDescription(string $description) : FilesystemPublishedDocumentEntity |
|
228
|
|
|
{ |
|
229
|
|
|
$this->container['description'] = $description; |
|
230
|
|
|
|
|
231
|
|
|
return $this; |
|
232
|
|
|
} |
|
233
|
|
|
|
|
234
|
|
|
/** |
|
235
|
|
|
* @return null|string |
|
236
|
|
|
*/ |
|
237
|
|
|
public function getDescription() : ? string |
|
238
|
|
|
{ |
|
239
|
|
|
return $this->container['description']; |
|
240
|
|
|
} |
|
241
|
|
|
|
|
242
|
|
|
/** |
|
243
|
|
|
* @param string $contentLead |
|
244
|
|
|
* @return FilesystemPublishedDocumentEntity |
|
245
|
|
|
*/ |
|
246
|
|
|
public function setContentLead(string $contentLead) : FilesystemPublishedDocumentEntity |
|
247
|
|
|
{ |
|
248
|
|
|
$this->container['content_lead'] = $contentLead; |
|
249
|
|
|
|
|
250
|
|
|
return $this; |
|
251
|
|
|
} |
|
252
|
|
|
|
|
253
|
|
|
/** |
|
254
|
|
|
* @return null|string |
|
255
|
|
|
*/ |
|
256
|
|
|
public function getContentLead() : ? string |
|
257
|
|
|
{ |
|
258
|
|
|
return $this->container['content_lead']; |
|
259
|
|
|
} |
|
260
|
|
|
|
|
261
|
|
|
/** |
|
262
|
|
|
* @param string $contentBody |
|
263
|
|
|
* @return FilesystemPublishedDocumentEntity |
|
264
|
|
|
*/ |
|
265
|
|
|
public function setContentBody(string $contentBody) : FilesystemPublishedDocumentEntity |
|
266
|
|
|
{ |
|
267
|
|
|
$this->container['content_body'] = $contentBody; |
|
268
|
|
|
|
|
269
|
|
|
return $this; |
|
270
|
|
|
} |
|
271
|
|
|
|
|
272
|
|
|
/** |
|
273
|
|
|
* @return null|string |
|
274
|
|
|
*/ |
|
275
|
|
|
public function getContentBody() : ? string |
|
276
|
|
|
{ |
|
277
|
|
|
return $this->container['content_body']; |
|
278
|
|
|
} |
|
279
|
|
|
|
|
280
|
|
|
/** |
|
281
|
|
|
* @param DateTime $dateTime |
|
282
|
|
|
* @return FilesystemPublishedDocumentEntity |
|
283
|
|
|
*/ |
|
284
|
|
|
public function setDatePublished(DateTime $dateTime) : FilesystemPublishedDocumentEntity |
|
285
|
|
|
{ |
|
286
|
|
|
$this->container['date_published'] = $dateTime->format('Y-m-d H:i:s'); |
|
287
|
|
|
|
|
288
|
|
|
return $this; |
|
289
|
|
|
} |
|
290
|
|
|
|
|
291
|
|
|
/** |
|
292
|
|
|
* @return null|DateTime |
|
293
|
|
|
*/ |
|
294
|
|
|
public function getDatePublished() : ? DateTime |
|
295
|
|
|
{ |
|
296
|
|
|
return !empty($this->container['date_published']) |
|
297
|
|
|
? new DateTime($this->container['date_published']) |
|
298
|
|
|
: null; |
|
299
|
|
|
} |
|
300
|
|
|
} |
|
301
|
|
|
|