Passed
Branch 0.1 (d41d7c)
by Nils
02:15
created

Group::getUpdatedAt()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Torakel\DatabaseBundle\Entity;
3
4
use Doctrine\Common\Collections\ArrayCollection;
5
use Doctrine\ORM\Mapping as ORM;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\Mapping was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
/**
8
 * @ORM\Entity
9
 * @ORM\HasLifecycleCallbacks
10
 * @ORM\Table(name="group")
11
 */
12
class Group
13
{
14
15
    /**
16
     * @var integer
17
     * @ORM\Column(type="integer")
18
     * @ORM\Id
19
     * @ORM\GeneratedValue(strategy="AUTO")
20
     */
21
    private $id;
22
23
    /**
24
     * @var string
25
     * @ORM\Column(type="string")
26
     */
27
    protected $slug;
28
29
    /**
30
     * @var string
31
     * @ORM\Column(type="string")
32
     */
33
    protected $name;
34
35
    /**
36
     * @var \Torakel\DatabaseBundle\Entity\Round
37
     * @ORM\ManyToOne(targetEntity="\Torakel\DatabaseBundle\Entity\Round", inversedBy="groups")
38
     * @ORM\JoinColumn(name="round_id", referencedColumnName="id")
39
     */
40
    protected $round;
41
42
    /**
43
     * @var \Doctrine\Common\Collections\ArrayCollection;
44
     * @ORM\OneToMany(targetEntity="\Torakel\DatabaseBundle\Entity\Matchday", mappedBy="group")
45
     */
46
    protected $matchdays;
47
48
    /**
49
     * @var integer
50
     * @ORM\Column(type="integer")
51
     */
52
    protected $position;
53
54
    /**
55
     * @var \DateTime
56
     * @ORM\Column(type="datetime", name="created_at")
57
     */
58
    protected $createdAt;
59
60
    /**
61
     * @var \DateTime
62
     * @ORM\Column(type="datetime", name="updated_at", nullable=true)
63
     */
64
    protected $updatedAt;
65
    /**
66
     * Constructor
67
     */
68 4
    public function __construct()
69
    {
70 4
        $this->matchdays = new \Doctrine\Common\Collections\ArrayCollection();
71 4
    }
72
73
    /**
74
     * Get id
75
     *
76
     * @return integer
77
     */
78 1
    public function getId()
79
    {
80 1
        return $this->id;
81
    }
82
83
    /**
84
     * Set slug
85
     *
86
     * @param string $slug
87
     *
88
     * @return Group
89
     */
90 1
    public function setSlug($slug)
91
    {
92 1
        $this->slug = $slug;
93
94 1
        return $this;
95
    }
96
97
    /**
98
     * Get slug
99
     *
100
     * @return string
101
     */
102 1
    public function getSlug()
103
    {
104 1
        return $this->slug;
105
    }
106
107
    /**
108
     * Set name
109
     *
110
     * @param string $name
111
     *
112
     * @return Group
113
     */
114 1
    public function setName($name)
115
    {
116 1
        $this->name = $name;
117
118 1
        return $this;
119
    }
120
121
    /**
122
     * Get name
123
     *
124
     * @return string
125
     */
126 1
    public function getName()
127
    {
128 1
        return $this->name;
129
    }
130
131
    /**
132
     * Set position
133
     *
134
     * @param integer $position
135
     *
136
     * @return Group
137
     */
138 1
    public function setPosition($position)
139
    {
140 1
        $this->position = $position;
141
142 1
        return $this;
143
    }
144
145
    /**
146
     * Get position
147
     *
148
     * @return integer
149
     */
150 1
    public function getPosition()
151
    {
152 1
        return $this->position;
153
    }
154
155
    /**
156
     * Set createdAt
157
     *
158
     * @param \DateTime $createdAt
159
     *
160
     * @return Group
161
     */
162 1
    public function setCreatedAt($createdAt)
163
    {
164 1
        $this->createdAt = $createdAt;
165
166 1
        return $this;
167
    }
168
169
    /**
170
     * Get createdAt
171
     *
172
     * @return \DateTime
173
     */
174 1
    public function getCreatedAt()
175
    {
176 1
        return $this->createdAt;
177
    }
178
179
    /**
180
     * Set updatedAt
181
     *
182
     * @param \DateTime $updatedAt
183
     *
184
     * @return Group
185
     */
186 1
    public function setUpdatedAt($updatedAt)
187
    {
188 1
        $this->updatedAt = $updatedAt;
189
190 1
        return $this;
191
    }
192
193
    /**
194
     * Get updatedAt
195
     *
196
     * @return \DateTime
197
     */
198 1
    public function getUpdatedAt()
199
    {
200 1
        return $this->updatedAt;
201
    }
202
203
    /**
204
     * Set round
205
     *
206
     * @param \Torakel\DatabaseBundle\Entity\Round $round
207
     *
208
     * @return Group
209
     */
210 1
    public function setRound(\Torakel\DatabaseBundle\Entity\Round $round = null)
211
    {
212 1
        $this->round = $round;
213
214 1
        return $this;
215
    }
216
217
    /**
218
     * Get round
219
     *
220
     * @return \Torakel\DatabaseBundle\Entity\Round
221
     */
222 1
    public function getRound()
223
    {
224 1
        return $this->round;
225
    }
226
227
    /**
228
     * Add matchday
229
     *
230
     * @param \Torakel\DatabaseBundle\Entity\Matchday $matchday
231
     *
232
     * @return Group
233
     */
234 1
    public function addMatchday(\Torakel\DatabaseBundle\Entity\Matchday $matchday)
235
    {
236 1
        $this->matchdays[] = $matchday;
237
238 1
        return $this;
239
    }
240
241
    /**
242
     * Remove matchday
243
     *
244
     * @param \Torakel\DatabaseBundle\Entity\Matchday $matchday
245
     */
246 1
    public function removeMatchday(\Torakel\DatabaseBundle\Entity\Matchday $matchday)
247
    {
248 1
        $this->matchdays->removeElement($matchday);
249 1
    }
250
251
    /**
252
     * Get matchdays
253
     *
254
     * @return \Doctrine\Common\Collections\Collection
255
     */
256 1
    public function getMatchdays()
257
    {
258 1
        return $this->matchdays;
259
    }
260
261
    /**
262
     * @ORM\PrePersist
263
     */
264 1
    public function prePersist()
265
    {
266 1
        $this->createdAt = new \DateTime();
267 1
    }
268
269
    /**
270
     * @ORM\PreUpdate
271
     */
272 1
    public function preUpdate()
273
    {
274 1
        $this->updatedAt = new \DateTime();
275 1
    }
276
}
277