Passed
Push — master ( 55824b...ad17d9 )
by Florian
03:36
created

Participant::getTimeNeededInSeconds()   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 0
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 participant answers the questions.
21
 *
22
 * @ORM\Entity()
23
 * @ORM\HasLifecycleCallbacks
24
 */
25
class Participant extends BaseEntity
26
{
27
    use IdTrait;
28
29
    /**
30
     * @var string
31
     *
32
     * @ORM\Column(type="text")
33
     */
34
    private $identifier;
35
36
    /**
37
     * @var int|null
38
     *
39
     * @ORM\Column(type="integer", nullable=true)
40
     */
41
    private $timeNeededInSeconds;
42
43
    /**
44
     * @var Answer[]|ArrayCollection
45
     *
46
     * @ORM\OneToMany(targetEntity="Answer", mappedBy="participant")
47
     */
48
    private $answers;
49
50
    /**
51
     * @var Event
52
     *
53
     * @ORM\ManyToOne(targetEntity="App\Entity\Event", inversedBy="participants")
54
     */
55
    private $event;
56
57
    /**
58
     * Participant constructor.
59
     */
60
    public function __construct()
61
    {
62
        $this->answers = new ArrayCollection();
63
    }
64
65
    /**
66
     * @return Answer[]|ArrayCollection
67
     */
68
    public function getAnswers()
69
    {
70
        return $this->answers;
71
    }
72
73
    /**
74
     * @return Event
75
     */
76
    public function getEvent(): Event
77
    {
78
        return $this->event;
79
    }
80
81
    /**
82
     * @param Event $event
83
     */
84
    public function setEvent(Event $event): void
85
    {
86
        $this->event = $event;
87
    }
88
89
    /**
90
     * @return int|null
91
     */
92
    public function getTimeNeededInSeconds(): ?int
93
    {
94
        return $this->timeNeededInSeconds;
95
    }
96
97
    /**
98
     * @param int|null $timeNeededInSeconds
99
     */
100
    public function setTimeNeededInSeconds(?int $timeNeededInSeconds): void
101
    {
102
        $this->timeNeededInSeconds = $timeNeededInSeconds;
103
    }
104
105
    /**
106
     * @return string
107
     */
108
    public function getIdentifier(): string
109
    {
110
        return $this->identifier;
111
    }
112
113
    /**
114
     * @param string $identifier
115
     */
116
    public function setIdentifier(string $identifier): void
117
    {
118
        $this->identifier = $identifier;
119
    }
120
}
121