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

FilesystemTagEntity::getFilesystemTagId()   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 FilesystemTagEntity
20
 */
21
class FilesystemTagEntity extends AbstractEntity
22
{
23
    /**
24
     * @var array
25
     */
26
    protected $container = [
27
        'id_filesystem_tag' => null,
28
        'fk_application' => null,
29
        'name' => null,
30
        'title' => null,
31
        'description' => null,
32
        'date_created' => null,
33
        'date_modified' => null,
34
    ];
35
36
    /**
37
     * @param int $identifier
38
     * @return FilesystemTagEntity
39
     */
40
    public function setFilesystemTagId(int $identifier) : FilesystemTagEntity
41
    {
42
        $this->container['id_filesystem_tag'] = $identifier;
43
44
        return $this;
45
    }
46
47
    /**
48
     * @return int|null
49
     */
50
    public function getFilesystemTagId() : ? int
51
    {
52
        return !is_null($this->container['id_filesystem_tag'])
53
            ? (int) $this->container['id_filesystem_tag']
54
            : null;
55
    }
56
57
    /**
58
     * @param int $applicationIdentifier
59
     * @return FilesystemTagEntity
60
     */
61
    public function setApplicationId(int $applicationIdentifier) : FilesystemTagEntity
62
    {
63
        $this->container['fk_application'] = $applicationIdentifier;
64
65
        return $this;
66
    }
67
68
    /**
69
     * @return int|null
70
     */
71
    public function getApplicationId() : ? int
72
    {
73
        return !is_null($this->container['fk_application'])
74
            ? (int) $this->container['fk_application']
75
            : null;
76
    }
77
78
    /**
79
     * @param string $name
80
     * @return FilesystemTagEntity
81
     */
82
    public function setName(string $name) : FilesystemTagEntity
83
    {
84
        $this->container['name'] = $name;
85
86
        return $this;
87
    }
88
89
    /**
90
     * @return null|string
91
     */
92
    public function getName() : ? string
93
    {
94
        return $this->container['name'];
95
    }
96
97
    /**
98
     * @param string $title
99
     * @return FilesystemTagEntity
100
     */
101
    public function setTitle(string $title) : FilesystemTagEntity
102
    {
103
        $this->container['title'] = $title;
104
105
        return $this;
106
    }
107
108
    /**
109
     * @return null|string
110
     */
111
    public function getTitle() : ? string
112
    {
113
        return $this->container['title'];
114
    }
115
116
    /**
117
     * @param string $description
118
     * @return FilesystemTagEntity
119
     */
120
    public function setDescription(string $description) : FilesystemTagEntity
121
    {
122
        $this->container['description'] = $description;
123
124
        return $this;
125
    }
126
127
    /**
128
     * @return null|string
129
     */
130
    public function getDescription() : ? string
131
    {
132
        return $this->container['description'];
133
    }
134
135
    /**
136
     * @param DateTime $dateTime
137
     * @return FilesystemTagEntity
138
     */
139
    public function setDateCreated(DateTime $dateTime) : FilesystemTagEntity
140
    {
141
        $this->container['date_created'] = $dateTime->format('Y-m-d H:i:s');
142
143
        return $this;
144
    }
145
146
    /**
147
     * @return null|DateTime
148
     */
149
    public function getDateCreated() : ? DateTime
150
    {
151
        return !empty($this->container['date_created'])
152
            ? new DateTime($this->container['date_created'])
153
            : null;
154
    }
155
156
    /**
157
     * @param DateTime $dateTime
158
     * @return FilesystemTagEntity
159
     */
160
    public function setDateModified(DateTime $dateTime) : FilesystemTagEntity
161
    {
162
        $this->container['date_modified'] = $dateTime->format('Y-m-d H:i:s');
163
164
        return $this;
165
    }
166
167
    /**
168
     * @return null|DateTime
169
     */
170
    public function getDateModified() : ? DateTime
171
    {
172
        return !empty($this->container['date_modified'])
173
            ? new DateTime($this->container['date_modified'])
174
            : null;
175
    }
176
}
177