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

Participant::getEvent()   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 Answer[]|ArrayCollection
31
     *
32
     * @ORM\OneToMany(targetEntity="Answer", mappedBy="participant")
33
     */
34
    private $answers;
35
36
    /**
37
     * @var Event
38
     *
39
     * @ORM\ManyToOne(targetEntity="App\Entity\Event", inversedBy="participants")
40
     */
41
    private $event;
42
43
    /**
44
     * Participant constructor.
45
     */
46
    public function __construct()
47
    {
48
        $this->answers = new ArrayCollection();
49
    }
50
51
    /**
52
     * @return Answer[]|ArrayCollection
53
     */
54
    public function getAnswers(): array
55
    {
56
        return $this->answers;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->answers returns the type App\Entity\Answer[]&Doct...ections\ArrayCollection which is incompatible with the type-hinted return array.
Loading history...
57
    }
58
59
    /**
60
     * @return Event
61
     */
62
    public function getEvent(): Event
63
    {
64
        return $this->event;
65
    }
66
67
    /**
68
     * @param Event $event
69
     */
70
    public function setEvent(Event $event): void
71
    {
72
        $this->event = $event;
73
    }
74
}
75