Event::getObjectType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * Copyright (c) 2016 Francois-Xavier Soubirou.
5
 *
6
 * This file is part of eco4.
7
 *
8
 * eco4 is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU General Public License as published by
10
 * the Free Software Foundation, either version 3 of the License, or
11
 * (at your option) any later version.
12
 *
13
 * eco4 is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with eco4. If not, see <http://www.gnu.org/licenses/>.
20
 */
21
declare(strict_types=1);
22
23
namespace AppBundle\Entity;
24
25
use DateTime;
26
use Doctrine\ORM\Mapping as ORM;
27
28
/**
29
 * Event entity class.
30
 *
31
 * @category  Eco4 App
32
 *
33
 * @author    Francois-Xavier Soubirou <[email protected]>
34
 * @copyright 2016 Francois-Xavier Soubirou
35
 * @license   http://www.gnu.org/licenses/   GPLv3
36
 *
37
 * @link      https://www.eco4.io
38
 *
39
 * @ORM\Table(name="eco4_event")
40
 * @ORM\Entity(repositoryClass="AppBundle\Repository\EventRepository")
41
 */
42
class Event
43
{
44
    const CAT_CREATE = 1;
45
    const CAT_UPGRADE = 2;
46
47
    const STATUS_PLANNED = 1;
48
    const STATUS_DONE = 2;
49
    const STATUS_CANCELED = 3;
50
51
    /**
52
     * @var int
53
     *
54
     * @ORM\Column(name="id", type="integer")
55
     * @ORM\Id
56
     * @ORM\GeneratedValue(strategy="AUTO")
57
     */
58
    private $id;
59
60
    /**
61
     * @var int
62
     *
63
     * @ORM\Column(name="category", type="integer")
64
     */
65
    protected $category;
66
67
    /**
68
     * @var int
69
     *
70
     * @ORM\Column(name="object_type", type="integer")
71
     */
72
    protected $objectType;
73
74
    /**
75
     * @var User
76
     *
77
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\User")
78
     * @ORM\JoinColumn(nullable=false)
79
     */
80
    protected $user;
81
82
    /**
83
     * @var \DateTime
84
     *
85
     * @ORM\Column(name="datetime_event", type="datetime")
86
     */
87
    private $eventDatetime;
88
89
    /**
90
     * @var int
91
     *
92
     * @ORM\Column(name="status", type="integer")
93
     */
94
    protected $status;
95
96
    /**
97
     * Get id.
98
     *
99
     * @return int
100
     */
101
    public function getId(): int
102
    {
103
        return $this->id;
104
    }
105
106
    /**
107
     * Set Category of event.
108
     *
109
     * @param int $category Category of event
110
     *
111
     * @return Event
112
     */
113
    public function setCategory(int $category): Event
114
    {
115
        $this->category = $category;
116
117
        return $this;
118
    }
119
120
    /**
121
     * Get Category of event.
122
     *
123
     * @return int
124
     */
125
    public function getCategory(): int
126
    {
127
        return $this->category;
128
    }
129
130
    /**
131
     * Set type of object.
132
     *
133
     * @param int $type Type of object
134
     *
135
     * @return Event
136
     */
137
    public function setObjectType(int $type): Event
138
    {
139
        $this->objectType = $type;
140
141
        return $this;
142
    }
143
144
    /**
145
     * Get type of object.
146
     *
147
     * @return int
148
     */
149
    public function getObjectType(): int
150
    {
151
        return $this->objectType;
152
    }
153
154
    /**
155
     * Set user.
156
     *
157
     * @param User $user User
158
     *
159
     * @return Event
160
     */
161
    public function setUser(User $user): Event
162
    {
163
        $this->user = $user;
164
165
        return $this;
166
    }
167
168
    /**
169
     * Get user.
170
     *
171
     * @return User
172
     */
173
    public function getUser(): User
174
    {
175
        return $this->user;
176
    }
177
178
    /**
179
     * Set date time of event.
180
     *
181
     * @param DateTime $datetime
182
     *
183
     * @return Event
184
     */
185
    public function setEventDatetime(DateTime $datetime): Event
186
    {
187
        $this->eventDatetime = $datetime;
188
189
        return $this;
190
    }
191
192
    /**
193
     * Get date time of event.
194
     *
195
     * @return DateTime
196
     */
197
    public function getEventDatetime(): DateTime
198
    {
199
        return $this->eventDatetime;
200
    }
201
202
    /**
203
     * Get status of event.
204
     *
205
     * @return int
206
     */
207
    public function getStatus(): int
208
    {
209
        return $this->status;
210
    }
211
212
    /**
213
     * Set status of event.
214
     *
215
     * @param int $status Status of event
216
     *
217
     * @return Event
218
     */
219
    public function setStatus(int $status): Event
220
    {
221
        $this->status = $status;
222
223
        return $this;
224
    }
225
}
226