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

FilesystemMetaEntity::getFilesystemMetaId()   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 FilesystemMetaEntity
20
 */
21
class FilesystemMetaEntity extends AbstractEntity
22
{
23
    /**
24
     * @var array
25
     */
26
    protected $container = [
27
        'id_filesystem_meta' => null,
28
        'fk_filesystem' => null,
29
        'meta_key' => null,
30
        'meta_data' => null,
31
        'date_created' => null,
32
        'date_modified' => null,
33
    ];
34
35
    /**
36
     * @param int $identifier
37
     * @return FilesystemMetaEntity
38
     */
39
    public function setFilesystemrMetaId(int $identifier) : FilesystemMetaEntity
40
    {
41
        $this->container['id_filesystem_meta'] = $identifier;
42
43
        return $this;
44
    }
45
46
    /**
47
     * @return int|null
48
     */
49
    public function getFilesystemMetaId() : ? int
50
    {
51
        return !is_null($this->container['id_filesystem_meta'])
52
            ? (int) $this->container['id_filesystem_meta']
53
            : null;
54
    }
55
56
    /**
57
     * @param int $userIdentifier
58
     * @return FilesystemMetaEntity
59
     */
60
    public function setFilesystemId(int $userIdentifier) : FilesystemMetaEntity
61
    {
62
        $this->container['fk_filesystem'] = $userIdentifier;
63
64
        return $this;
65
    }
66
67
    /**
68
     * @return int|null
69
     */
70
    public function getFilesystemId() : ? int
71
    {
72
        return !is_null($this->container['fk_filesystem'])
73
            ? (int) $this->container['fk_filesystem']
74
            : null;
75
    }
76
77
    /**
78
     * @param string $metaKey
79
     * @return FilesystemMetaEntity
80
     */
81
    public function setMetaKey(string $metaKey) : FilesystemMetaEntity
82
    {
83
        $this->container['meta_key'] = $metaKey;
84
85
        return $this;
86
    }
87
88
    /**
89
     * @return null|string
90
     */
91
    public function getMetaKey() : ? string
92
    {
93
        return $this->container['meta_key'];
94
    }
95
96
    /**
97
     * @param string $metaData
98
     * @return FilesystemMetaEntity
99
     */
100
    public function setMetaData(string $metaData) : FilesystemMetaEntity
101
    {
102
        $this->container['meta_data'] = $metaData;
103
104
        return $this;
105
    }
106
107
    /**
108
     * @return null|string
109
     */
110
    public function getMetaData() : ? string
111
    {
112
        return $this->container['meta_data'];
113
    }
114
115
    /**
116
     * @param DateTime $dateTime
117
     * @return FilesystemMetaEntity
118
     */
119
    public function setDateCreated(DateTime $dateTime) : FilesystemMetaEntity
120
    {
121
        $this->container['date_created'] = $dateTime->format('Y-m-d H:i:s');
122
123
        return $this;
124
    }
125
126
    /**
127
     * @return null|DateTime
128
     */
129
    public function getDateCreated() : ? DateTime
130
    {
131
        return !empty($this->container['date_created'])
132
            ? new DateTime($this->container['date_created'])
133
            : null;
134
    }
135
136
    /**
137
     * @param DateTime $dateTime
138
     * @return FilesystemMetaEntity
139
     */
140
    public function setDateModified(DateTime $dateTime) : FilesystemMetaEntity
141
    {
142
        $this->container['date_modified'] = $dateTime->format('Y-m-d H:i:s');
143
144
        return $this;
145
    }
146
147
    /**
148
     * @return null|DateTime
149
     */
150
    public function getDateModified() : ? DateTime
151
    {
152
        return !empty($this->container['date_modified'])
153
            ? new DateTime($this->container['date_modified'])
154
            : null;
155
    }
156
}
157