Passed
Push — master ( b5ff3f...de0fbe )
by Julito
09:48
created

GradebookResult::getEvaluationId()   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
/* For licensing terms, see /license.txt */
4
5
namespace Chamilo\CoreBundle\Entity;
6
7
use Chamilo\CoreBundle\Traits\UserTrait;
8
use Doctrine\ORM\Mapping as ORM;
9
use Gedmo\Mapping\Annotation as Gedmo;
10
11
/**
12
 * GradebookResult.
13
 *
14
 * @ORM\Table(name="gradebook_result",
15
 *  indexes={
16
 *     @ORM\Index(name="idx_gb_uid_eid", columns={"user_id", "evaluation_id"}),
17
 * })
18
 *
19
 * @ORM\Entity
20
 */
21
class GradebookResult
22
{
23
    use UserTrait;
24
25
    /**
26
     * @var int
27
     *
28
     * @ORM\Column(name="id", type="integer")
29
     * @ORM\Id
30
     * @ORM\GeneratedValue(strategy="IDENTITY")
31
     */
32
    protected $id;
33
34
    /**
35
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\GradebookEvaluation")
36
     * @ORM\JoinColumn(name="evaluation_id", referencedColumnName="id")
37
     */
38
    protected GradebookEvaluation $evaluation;
39
40
    /**
41
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", inversedBy="gradeBookResults")
42
     * @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
43
     */
44
    protected User $user;
45
46
    /**
47
     * @var float
48
     *
49
     * @ORM\Column(name="score", type="float", precision=10, scale=0, nullable=true)
50
     */
51
    protected $score;
52
53
    /**
54
     * @var \DateTime
55
     *
56
     * @Gedmo\Timestampable(on="create")
57
     * @ORM\Column(name="created_at", type="datetime", nullable=false)
58
     */
59
    protected $createdAt;
60
61
    /**
62
     * Set createdAt.
63
     *
64
     * @param \DateTime $createdAt
65
     *
66
     * @return GradebookResult
67
     */
68
    public function setCreatedAt($createdAt)
69
    {
70
        $this->createdAt = $createdAt;
71
72
        return $this;
73
    }
74
75
    /**
76
     * Get createdAt.
77
     *
78
     * @return \DateTime
79
     */
80
    public function getCreatedAt()
81
    {
82
        return $this->createdAt;
83
    }
84
85
    /**
86
     * Set score.
87
     *
88
     * @param float $score
89
     *
90
     * @return GradebookResult
91
     */
92
    public function setScore($score)
93
    {
94
        $this->score = $score;
95
96
        return $this;
97
    }
98
99
    /**
100
     * Get score.
101
     *
102
     * @return float
103
     */
104
    public function getScore()
105
    {
106
        return $this->score;
107
    }
108
109
    /**
110
     * Get id.
111
     *
112
     * @return int
113
     */
114
    public function getId()
115
    {
116
        return $this->id;
117
    }
118
}
119