Passed
Push — master ( 732152...809fdb )
by Florian
03:32
created

Semester::setCreationDate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the feedback project.
5
 *
6
 * (c) Florian Moser <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace App\Entity;
13
14
use App\Entity\Base\BaseEntity;
15
use App\Entity\Traits\IdTrait;
16
use Doctrine\Common\Collections\ArrayCollection;
17
use Doctrine\ORM\Mapping as ORM;
18
19
/**
20
 * a semester contains of events.
21
 *
22
 * @ORM\Entity()
23
 * @ORM\HasLifecycleCallbacks
24
 */
25
class Semester extends BaseEntity
26
{
27
    use IdTrait;
28
29
    /**
30
     * @var string
31
     *
32
     * @ORM\Column(type="text")
33
     */
34
    private $name;
35
36
    /**
37
     * @var \DateTime
38
     *
39
     * @ORM\Column(type="datetime")
40
     */
41
    private $creationDate;
42
43
    /**
44
     * @var Event[]|ArrayCollection
45
     *
46
     * @ORM\OneToMany(targetEntity="Event", mappedBy="semester")
47
     * @ORM\OrderBy({"date" = "DESC", "feedbackStartTime" = "DESC", "feedbackEndTime" = "DESC"})
48
     */
49
    private $events;
50
51
    /**
52
     * Semester constructor.
53
     */
54
    public function __construct()
55
    {
56
        $this->events = new ArrayCollection();
57
    }
58
59
    /**
60
     * @return string
61
     */
62
    public function getName(): string
63
    {
64
        return $this->name;
65
    }
66
67
    /**
68
     * @param string $name
69
     */
70
    public function setName(string $name): void
71
    {
72
        $this->name = $name;
73
    }
74
75
    /**
76
     * @return Event[]|ArrayCollection
77
     */
78
    public function getEvents()
79
    {
80
        return $this->events;
81
    }
82
83
    /**
84
     * @return \DateTime
85
     */
86
    public function getCreationDate(): \DateTime
87
    {
88
        return $this->creationDate;
89
    }
90
91
    /**
92
     * @param \DateTime $creationDate
93
     */
94
    public function setCreationDate(\DateTime $creationDate): void
95
    {
96
        $this->creationDate = $creationDate;
97
    }
98
}
99