Passed
Push — master ( 8d1a37...25babe )
by Julito
22:45
created

UsergroupRelQuestion::setCoefficient()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
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\CoreBundle\Entity;
8
9
use Chamilo\CourseBundle\Entity\CQuizQuestion;
10
use Doctrine\ORM\Mapping as ORM;
11
12
/**
13
 * UsergroupRelQuestion.
14
 *
15
 * @ORM\Table(name="usergroup_rel_question")
16
 * @ORM\Entity
17
 */
18
class UsergroupRelQuestion
19
{
20
    /**
21
     * @ORM\Column(name="id", type="integer")
22
     * @ORM\Id
23
     * @ORM\GeneratedValue
24
     */
25
    protected int $id;
26
27
    /**
28
     * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CQuizQuestion")
29
     * @ORM\JoinColumn(name="question_id", referencedColumnName="iid", onDelete="CASCADE")
30
     */
31
    protected CQuizQuestion $question;
32
33
    /**
34
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Usergroup", inversedBy="questions")
35
     * @ORM\JoinColumn(name="usergroup_id", referencedColumnName="id", onDelete="CASCADE")
36
     */
37
    protected Usergroup $usergroup;
38
39
    /**
40
     * @ORM\Column(name="coefficient", type="float", precision=6, scale=2, nullable=true)
41
     */
42
    protected ?float $coefficient = null;
43
44
    /**
45
     * Get id.
46
     *
47
     * @return int
48
     */
49
    public function getId()
50
    {
51
        return $this->id;
52
    }
53
54
    public function setCoefficient(float $coefficient): self
55
    {
56
        $this->coefficient = $coefficient;
57
58
        return $this;
59
    }
60
61
    /**
62
     * Get coefficient.
63
     *
64
     * @return float
65
     */
66
    public function getCoefficient()
67
    {
68
        return $this->coefficient;
69
    }
70
71
    public function getQuestion(): CQuizQuestion
72
    {
73
        return $this->question;
74
    }
75
76
    public function setQuestion(CQuizQuestion $question): self
77
    {
78
        $this->question = $question;
79
80
        return $this;
81
    }
82
83
    public function getUsergroup(): Usergroup
84
    {
85
        return $this->usergroup;
86
    }
87
88
    public function setUsergroup(Usergroup $usergroup): self
89
    {
90
        $this->usergroup = $usergroup;
91
92
        return $this;
93
    }
94
}
95