Passed
Push — master ( b28532...61a578 )
by Julito
11:48 queued 36s
created

GradebookCertificate::getCreatedAt()   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\CoreBundle\Entity;
8
9
use Chamilo\CoreBundle\Traits\UserTrait;
10
use DateTime;
11
use Doctrine\ORM\Mapping as ORM;
12
use Gedmo\Mapping\Annotation as Gedmo;
13
14
/**
15
 * @ORM\Table(
16
 *     name="gradebook_certificate",
17
 *     indexes={
18
 *         @ORM\Index(name="idx_gradebook_certificate_user_id", columns={"user_id"}),
19
 *     }
20
 * )
21
 * @ORM\Entity
22
 */
23
class GradebookCertificate
24
{
25
    use UserTrait;
26
27
    /**
28
     * @ORM\Column(name="id", type="bigint")
29
     * @ORM\Id
30
     * @ORM\GeneratedValue
31
     */
32
    protected int $id;
33
34
    /**
35
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\GradebookCategory")
36
     * @ORM\JoinColumn(name="cat_id", referencedColumnName="id", onDelete="CASCADE")
37
     */
38
    protected GradebookCategory $category;
39
40
    /**
41
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", inversedBy="gradeBookCertificates")
42
     * @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
43
     */
44
    protected User $user;
45
46
    /**
47
     * @ORM\Column(name="score_certificate", type="float", precision=10, scale=0, nullable=false)
48
     */
49
    protected float $scoreCertificate;
50
51
    /**
52
     * @Gedmo\Timestampable(on="create")
53
     * @ORM\Column(name="created_at", type="datetime", nullable=false)
54
     */
55
    protected DateTime $createdAt;
56
57
    /**
58
     * @ORM\Column(name="path_certificate", type="text", nullable=true)
59
     */
60
    protected ?string $pathCertificate = null;
61
62
    /**
63
     * @ORM\Column(name="downloaded_at", type="datetime", nullable=true)
64
     */
65
    protected ?DateTime $downloadedAt = null;
66
67
    public function setScoreCertificate(float $scoreCertificate): self
68
    {
69
        $this->scoreCertificate = $scoreCertificate;
70
71
        return $this;
72
    }
73
74
    /**
75
     * Get scoreCertificate.
76
     *
77
     * @return float
78
     */
79
    public function getScoreCertificate()
80
    {
81
        return $this->scoreCertificate;
82
    }
83
84
    public function setCreatedAt(DateTime $createdAt): self
85
    {
86
        $this->createdAt = $createdAt;
87
88
        return $this;
89
    }
90
91
    /**
92
     * Get createdAt.
93
     *
94
     * @return DateTime
95
     */
96
    public function getCreatedAt()
97
    {
98
        return $this->createdAt;
99
    }
100
101
    public function setPathCertificate(string $pathCertificate): self
102
    {
103
        $this->pathCertificate = $pathCertificate;
104
105
        return $this;
106
    }
107
108
    /**
109
     * Get pathCertificate.
110
     *
111
     * @return string
112
     */
113
    public function getPathCertificate()
114
    {
115
        return $this->pathCertificate;
116
    }
117
118
    /**
119
     * Get id.
120
     *
121
     * @return int
122
     */
123
    public function getId()
124
    {
125
        return $this->id;
126
    }
127
128
    public function getDownloadedAt(): DateTime
129
    {
130
        return $this->downloadedAt;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->downloadedAt could return the type null which is incompatible with the type-hinted return DateTime. Consider adding an additional type-check to rule them out.
Loading history...
131
    }
132
133
    public function setDownloadedAt(DateTime $downloadedAt): self
134
    {
135
        $this->downloadedAt = $downloadedAt;
136
137
        return $this;
138
    }
139
140
    public function getCategory(): GradebookCategory
141
    {
142
        return $this->category;
143
    }
144
145
    public function setCategory(GradebookCategory $category): self
146
    {
147
        $this->category = $category;
148
149
        return $this;
150
    }
151
152
    public function getUser(): User
153
    {
154
        return $this->user;
155
    }
156
157
    public function setUser(User $user): self
158
    {
159
        $this->user = $user;
160
161
        return $this;
162
    }
163
}
164