Test Failed
Branch lab/data (a414ec)
by Gabor
07:41
created

FilesystemDocumentEntity::getParentRevisionId()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
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 FilesystemDocumentEntity
20
 */
21
class FilesystemDocumentEntity extends AbstractEntity
22
{
23
    /**
24
     * @var array
25
     */
26
    protected $container = [
27
        'id_filesystem_document' => null,
28
        'fk_parent_revision' => null,
29
        'fk_author' => null,
30
        'content_revision' => null,
31
        'content_lead' => null,
32
        'content_body' => null,
33
        'date_created' => null,
34
        'date_modified' => null,
35
    ];
36
37
    /**
38
     * @param int $identifier
39
     * @return FilesystemDocumentEntity
40
     */
41
    public function setFilesystemDocumentId(int $identifier) : FilesystemDocumentEntity
42
    {
43
        $this->container['id_filesystem_document'] = $identifier;
44
45
        return $this;
46
    }
47
48
    /**
49
     * @return int|null
50
     */
51
    public function getFilesystemDocumentId() : ? int
52
    {
53
        return !is_null($this->container['id_filesystem_document'])
54
            ? (int) $this->container['id_filesystem_document']
55
            : null;
56
    }
57
58
    /**
59
     * @param int $parentRevisionIdentifier
60
     * @return FilesystemDocumentEntity
61
     */
62
    public function setParentRevisionId(int $parentRevisionIdentifier) : FilesystemDocumentEntity
63
    {
64
        $this->container['fk_parent_revision'] = $parentRevisionIdentifier;
65
66
        return $this;
67
    }
68
69
    /**
70
     * @return int|null
71
     */
72
    public function getParentRevisionId() : ? int
73
    {
74
        return !is_null($this->container['fk_parent_revision'])
75
            ? (int) $this->container['fk_parent_revision']
76
            : null;
77
    }
78
79
    /**
80
     * @param int $authorIdentifier
81
     * @return FilesystemDocumentEntity
82
     */
83
    public function setAuthorId(int $authorIdentifier) : FilesystemDocumentEntity
84
    {
85
        $this->container['fk_author'] = $authorIdentifier;
86
87
        return $this;
88
    }
89
90
    /**
91
     * @return int|null
92
     */
93
    public function getAuthorId() : ? int
94
    {
95
        return !is_null($this->container['fk_author'])
96
            ? (int) $this->container['fk_author']
97
            : null;
98
    }
99
100
    /**
101
     * @param int $contentRevision
102
     * @return FilesystemDocumentEntity
103
     */
104
    public function setContentRevision(int $contentRevision) : FilesystemDocumentEntity
105
    {
106
        $this->container['content_revision'] = $contentRevision;
107
108
        return $this;
109
    }
110
111
    /**
112
     * @return int|null
113
     */
114
    public function getContentRevision() : ? int
115
    {
116
        return !is_null($this->container['content_revision'])
117
            ? (int) $this->container['content_revision']
118
            : null;
119
    }
120
121
    /**
122
     * @param string $contentLead
123
     * @return FilesystemDocumentEntity
124
     */
125
    public function setContentLead(string $contentLead) : FilesystemDocumentEntity
126
    {
127
        $this->container['content_lead'] = $contentLead;
128
129
        return $this;
130
    }
131
132
    /**
133
     * @return null|string
134
     */
135
    public function getContentLead() : ? string
136
    {
137
        return $this->container['content_lead'];
138
    }
139
140
    /**
141
     * @param string $contentBody
142
     * @return FilesystemDocumentEntity
143
     */
144
    public function setContentBody(string $contentBody) : FilesystemDocumentEntity
145
    {
146
        $this->container['content_body'] = $contentBody;
147
148
        return $this;
149
    }
150
151
    /**
152
     * @return null|string
153
     */
154
    public function getContentBody() : ? string
155
    {
156
        return $this->container['content_body'];
157
    }
158
159
    /**
160
     * @param DateTime $dateTime
161
     * @return FilesystemDocumentEntity
162
     */
163
    public function setDateCreated(DateTime $dateTime) : FilesystemDocumentEntity
164
    {
165
        $this->container['date_created'] = $dateTime->format('Y-m-d H:i:s');
166
167
        return $this;
168
    }
169
170
    /**
171
     * @return null|DateTime
172
     */
173
    public function getDateCreated() : ? DateTime
174
    {
175
        return !empty($this->container['date_created'])
176
            ? new DateTime($this->container['date_created'])
177
            : null;
178
    }
179
180
    /**
181
     * @param DateTime $dateTime
182
     * @return FilesystemDocumentEntity
183
     */
184
    public function setDateModified(DateTime $dateTime) : FilesystemDocumentEntity
185
    {
186
        $this->container['date_modified'] = $dateTime->format('Y-m-d H:i:s');
187
188
        return $this;
189
    }
190
191
    /**
192
     * @return null|DateTime
193
     */
194
    public function getDateModified() : ? DateTime
195
    {
196
        return !empty($this->container['date_modified'])
197
            ? new DateTime($this->container['date_modified'])
198
            : null;
199
    }
200
}
201