Passed
Push — master ( 3b9d17...c5f69b )
by Julito
17:12
created

CQuizQuestionOption::getIid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/* For licensing terms, see /license.txt */
6
7
namespace Chamilo\CourseBundle\Entity;
8
9
use Doctrine\ORM\Mapping as ORM;
10
use Symfony\Component\Validator\Constraints as Assert;
11
12
/**
13
 * CQuizQuestionOption.
14
 *
15
 * @ORM\Table(
16
 *     name="c_quiz_question_option",
17
 *     indexes={
18
 *     }
19
 * )
20
 * @ORM\Entity
21
 */
22
class CQuizQuestionOption
23
{
24
    /**
25
     * @ORM\Column(name="iid", type="integer")
26
     * @ORM\Id
27
     * @ORM\GeneratedValue
28
     */
29
    protected int $iid;
30
31
    /**
32
     * @ORM\Column(name="name", type="string", length=255, nullable=false)
33
     */
34
    protected string $name;
35
36
    /**
37
     * @ORM\Column(name="position", type="integer", nullable=false)
38
     */
39
    protected int $position;
40
41
    /**
42
     * @Assert\NotBlank()
43
     * @ORM\ManyToOne(targetEntity="CQuizQuestion", cascade={"persist"}, inversedBy="options")
44
     * @ORM\JoinColumn(name="question_id", referencedColumnName="iid", onDelete="CASCADE")
45
     */
46
    protected CQuizQuestion $question;
47
48
    public function setName(string $name): self
49
    {
50
        $this->name = $name;
51
52
        return $this;
53
    }
54
55
    /**
56
     * Get name.
57
     *
58
     * @return string
59
     */
60
    public function getName()
61
    {
62
        return $this->name;
63
    }
64
65
    public function setPosition(int $position): self
66
    {
67
        $this->position = $position;
68
69
        return $this;
70
    }
71
72
    /**
73
     * Get position.
74
     *
75
     * @return int
76
     */
77
    public function getPosition()
78
    {
79
        return $this->position;
80
    }
81
82
    public function getQuestion(): CQuizQuestion
83
    {
84
        return $this->question;
85
    }
86
87
    public function setQuestion(CQuizQuestion $question): self
88
    {
89
        $this->question = $question;
90
91
        return $this;
92
    }
93
}
94