|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* WebHemi. |
|
4
|
|
|
* |
|
5
|
|
|
* PHP version 7.1 |
|
6
|
|
|
* |
|
7
|
|
|
* @copyright 2012 - 2017 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\Filesystem; |
|
15
|
|
|
|
|
16
|
|
|
use WebHemi\Data\EntityInterface; |
|
17
|
|
|
use WebHemi\DateTime; |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* Class FilesystemDocumentEntity. |
|
21
|
|
|
*/ |
|
22
|
|
|
class FilesystemDocumentEntity implements EntityInterface |
|
23
|
|
|
{ |
|
24
|
|
|
/** @var int */ |
|
25
|
|
|
private $filesystemDocumentId; |
|
26
|
|
|
/** @var int */ |
|
27
|
|
|
private $parentRevisionId; |
|
28
|
|
|
/** @var int */ |
|
29
|
|
|
private $authorId; |
|
30
|
|
|
/** @var int */ |
|
31
|
|
|
private $contentRevision; |
|
32
|
|
|
/** @var string */ |
|
33
|
|
|
private $contentLead; |
|
34
|
|
|
/** @var string */ |
|
35
|
|
|
private $contentBody; |
|
36
|
|
|
/** @var DateTime */ |
|
37
|
|
|
private $dateCreated; |
|
38
|
|
|
/** @var DateTime */ |
|
39
|
|
|
private $dateModified; |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* Sets the value of the entity identifier. |
|
43
|
|
|
* |
|
44
|
|
|
* @param int $entityId |
|
45
|
|
|
* @return FilesystemDocumentEntity |
|
46
|
|
|
*/ |
|
47
|
|
|
public function setKeyData(int $entityId) : FilesystemDocumentEntity |
|
48
|
|
|
{ |
|
49
|
|
|
$this->filesystemDocumentId = $entityId; |
|
50
|
|
|
|
|
51
|
|
|
return $this; |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
/** |
|
55
|
|
|
* Gets the value of the entity identifier. |
|
56
|
|
|
* |
|
57
|
|
|
* @return null|int |
|
58
|
|
|
*/ |
|
59
|
|
|
public function getKeyData() : ? int |
|
60
|
|
|
{ |
|
61
|
|
|
return $this->filesystemDocumentId; |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* @param int $filesystemDocumentId |
|
66
|
|
|
* @return FilesystemDocumentEntity |
|
67
|
|
|
*/ |
|
68
|
|
|
public function setFilesystemDocumentId(int $filesystemDocumentId) : FilesystemDocumentEntity |
|
69
|
|
|
{ |
|
70
|
|
|
$this->filesystemDocumentId = $filesystemDocumentId; |
|
71
|
|
|
|
|
72
|
|
|
return $this; |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* @return null|int |
|
77
|
|
|
*/ |
|
78
|
|
|
public function getFilesystemDocumentId() : ? int |
|
79
|
|
|
{ |
|
80
|
|
|
return $this->filesystemDocumentId; |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
/** |
|
84
|
|
|
* @param null|int $parentRevisionId |
|
85
|
|
|
* @return FilesystemDocumentEntity |
|
86
|
|
|
*/ |
|
87
|
|
|
public function setParentRevisionId(? int $parentRevisionId) : FilesystemDocumentEntity |
|
88
|
|
|
{ |
|
89
|
|
|
$this->parentRevisionId = $parentRevisionId; |
|
90
|
|
|
|
|
91
|
|
|
return $this; |
|
92
|
|
|
} |
|
93
|
|
|
|
|
94
|
|
|
/** |
|
95
|
|
|
* @return null|int |
|
96
|
|
|
*/ |
|
97
|
|
|
public function getParentRevisionId() : ? int |
|
98
|
|
|
{ |
|
99
|
|
|
return $this->parentRevisionId; |
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
|
/** |
|
103
|
|
|
* @param null|int $authorId |
|
104
|
|
|
* @return FilesystemDocumentEntity |
|
105
|
|
|
*/ |
|
106
|
|
|
public function setAuthorId(? int $authorId) : FilesystemDocumentEntity |
|
107
|
|
|
{ |
|
108
|
|
|
$this->authorId = $authorId; |
|
109
|
|
|
|
|
110
|
|
|
return $this; |
|
111
|
|
|
} |
|
112
|
|
|
|
|
113
|
|
|
/** |
|
114
|
|
|
* @return null|int |
|
115
|
|
|
*/ |
|
116
|
|
|
public function getAuthorId() : ? int |
|
117
|
|
|
{ |
|
118
|
|
|
return $this->authorId; |
|
119
|
|
|
} |
|
120
|
|
|
|
|
121
|
|
|
/** |
|
122
|
|
|
* @param int $contentRevision |
|
123
|
|
|
* @return FilesystemDocumentEntity |
|
124
|
|
|
*/ |
|
125
|
|
|
public function setContentRevision(int $contentRevision) : FilesystemDocumentEntity |
|
126
|
|
|
{ |
|
127
|
|
|
$this->contentRevision = $contentRevision; |
|
128
|
|
|
|
|
129
|
|
|
return $this; |
|
130
|
|
|
} |
|
131
|
|
|
|
|
132
|
|
|
/** |
|
133
|
|
|
* @return null|int |
|
134
|
|
|
*/ |
|
135
|
|
|
public function getContentRevision() : ? int |
|
136
|
|
|
{ |
|
137
|
|
|
return $this->contentRevision; |
|
138
|
|
|
} |
|
139
|
|
|
|
|
140
|
|
|
/** |
|
141
|
|
|
* @param string $contentLead |
|
142
|
|
|
* @return FilesystemDocumentEntity |
|
143
|
|
|
*/ |
|
144
|
|
|
public function setContentLead(string $contentLead) : FilesystemDocumentEntity |
|
145
|
|
|
{ |
|
146
|
|
|
$this->contentLead = $contentLead; |
|
147
|
|
|
|
|
148
|
|
|
return $this; |
|
149
|
|
|
} |
|
150
|
|
|
|
|
151
|
|
|
/** |
|
152
|
|
|
* @return null|string |
|
153
|
|
|
*/ |
|
154
|
|
|
public function getContentLead() : ? string |
|
155
|
|
|
{ |
|
156
|
|
|
return $this->contentLead; |
|
157
|
|
|
} |
|
158
|
|
|
|
|
159
|
|
|
/** |
|
160
|
|
|
* @param string $contentBody |
|
161
|
|
|
* @return FilesystemDocumentEntity |
|
162
|
|
|
*/ |
|
163
|
|
|
public function setContentBody(string $contentBody) : FilesystemDocumentEntity |
|
164
|
|
|
{ |
|
165
|
|
|
$this->contentBody = $contentBody; |
|
166
|
|
|
|
|
167
|
|
|
return $this; |
|
168
|
|
|
} |
|
169
|
|
|
|
|
170
|
|
|
/** |
|
171
|
|
|
* @return null|string |
|
172
|
|
|
*/ |
|
173
|
|
|
public function getContentBody() : ? string |
|
174
|
|
|
{ |
|
175
|
|
|
return $this->contentBody; |
|
176
|
|
|
} |
|
177
|
|
|
|
|
178
|
|
|
/** |
|
179
|
|
|
* @param DateTime $dateCreated |
|
180
|
|
|
* @return FilesystemDocumentEntity |
|
181
|
|
|
*/ |
|
182
|
|
|
public function setDateCreated(DateTime $dateCreated) : FilesystemDocumentEntity |
|
183
|
|
|
{ |
|
184
|
|
|
$this->dateCreated = $dateCreated; |
|
185
|
|
|
|
|
186
|
|
|
return $this; |
|
187
|
|
|
} |
|
188
|
|
|
|
|
189
|
|
|
/** |
|
190
|
|
|
* @return null|DateTime |
|
191
|
|
|
*/ |
|
192
|
|
|
public function getDateCreated() : ? DateTime |
|
193
|
|
|
{ |
|
194
|
|
|
return $this->dateCreated; |
|
195
|
|
|
} |
|
196
|
|
|
|
|
197
|
|
|
/** |
|
198
|
|
|
* @param DateTime $dateModified |
|
199
|
|
|
* @return FilesystemDocumentEntity |
|
200
|
|
|
*/ |
|
201
|
|
|
public function setDateModified(DateTime $dateModified) : FilesystemDocumentEntity |
|
202
|
|
|
{ |
|
203
|
|
|
$this->dateModified = $dateModified; |
|
204
|
|
|
|
|
205
|
|
|
return $this; |
|
206
|
|
|
} |
|
207
|
|
|
|
|
208
|
|
|
/** |
|
209
|
|
|
* @return null|DateTime |
|
210
|
|
|
*/ |
|
211
|
|
|
public function getDateModified() : ? DateTime |
|
212
|
|
|
{ |
|
213
|
|
|
return $this->dateModified; |
|
214
|
|
|
} |
|
215
|
|
|
} |
|
216
|
|
|
|