Passed
Push — master ( 5a0940...f02335 )
by Julito
12:50 queued 02:57
created

CStudentPublicationAssignment::getPublicationId()   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 DateTime;
10
use Doctrine\ORM\Mapping as ORM;
11
12
/**
13
 * CStudentPublicationAssignment.
14
 *
15
 * @ORM\Table(
16
 *  name="c_student_publication_assignment",
17
 *  indexes={
18
 *      @ORM\Index(name="course", columns={"c_id"})
19
 *  }
20
 * )
21
 * @ORM\Entity
22
 */
23
class CStudentPublicationAssignment
24
{
25
    /**
26
     * @ORM\Column(name="iid", type="integer")
27
     * @ORM\Id
28
     * @ORM\GeneratedValue
29
     */
30
    protected int $iid;
31
32
    /**
33
     * @ORM\Column(name="c_id", type="integer")
34
     */
35
    protected int $cId;
36
37
    /**
38
     * @ORM\Column(name="expires_on", type="datetime", nullable=true)
39
     */
40
    protected ?DateTime $expiresOn;
41
42
    /**
43
     * @ORM\Column(name="ends_on", type="datetime", nullable=true)
44
     */
45
    protected ?DateTime $endsOn;
46
47
    /**
48
     * @ORM\Column(name="add_to_calendar", type="integer", nullable=false)
49
     */
50
    protected bool $addToCalendar;
51
52
    /**
53
     * @ORM\Column(name="enable_qualification", type="boolean", nullable=false)
54
     */
55
    protected bool $enableQualification;
56
57
    /**
58
     * @ORM\OneToOne(targetEntity="CStudentPublication", inversedBy="assignment")
59
     * @ORM\JoinColumn(name="publication_id", referencedColumnName="iid", onDelete="CASCADE")
60
     */
61
    protected CStudentPublication $publication;
62
63
    public function __toString(): string
64
    {
65
        return (string) $this->getIid();
66
    }
67
68
    public function getIid(): int
69
    {
70
        return $this->iid;
71
    }
72
73
    /**
74
     * Set expiresOn.
75
     *
76
     * @param DateTime $expiresOn
77
     */
78
    public function setExpiresOn($expiresOn): self
79
    {
80
        $this->expiresOn = $expiresOn;
81
82
        return $this;
83
    }
84
85
    /**
86
     * Get expiresOn.
87
     *
88
     * @return DateTime
89
     */
90
    public function getExpiresOn()
91
    {
92
        return $this->expiresOn;
93
    }
94
95
    /**
96
     * Set endsOn.
97
     *
98
     * @param DateTime $endsOn
99
     */
100
    public function setEndsOn($endsOn): self
101
    {
102
        $this->endsOn = $endsOn;
103
104
        return $this;
105
    }
106
107
    /**
108
     * Get endsOn.
109
     *
110
     * @return DateTime
111
     */
112
    public function getEndsOn()
113
    {
114
        return $this->endsOn;
115
    }
116
117
    /**
118
     * Set addToCalendar.
119
     *
120
     * @param bool $addToCalendar
121
     */
122
    public function setAddToCalendar($addToCalendar): self
123
    {
124
        $this->addToCalendar = $addToCalendar;
0 ignored issues
show
Documentation Bug introduced by
The property $addToCalendar was declared of type integer, but $addToCalendar is of type boolean. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
125
126
        return $this;
127
    }
128
129
    /**
130
     * Get addToCalendar.
131
     *
132
     * @return bool
133
     */
134
    public function getAddToCalendar()
135
    {
136
        return $this->addToCalendar;
137
    }
138
139
    /**
140
     * Set enableQualification.
141
     *
142
     * @param bool $enableQualification
143
     */
144
    public function setEnableQualification($enableQualification): self
145
    {
146
        $this->enableQualification = $enableQualification;
147
148
        return $this;
149
    }
150
151
    /**
152
     * Get enableQualification.
153
     *
154
     * @return bool
155
     */
156
    public function getEnableQualification()
157
    {
158
        return $this->enableQualification;
159
    }
160
161
    /**
162
     * Set cId.
163
     *
164
     * @param int $cId
165
     *
166
     * @return CStudentPublicationAssignment
167
     */
168
    public function setCId($cId)
169
    {
170
        $this->cId = $cId;
171
172
        return $this;
173
    }
174
175
    /**
176
     * Get cId.
177
     *
178
     * @return int
179
     */
180
    public function getCId()
181
    {
182
        return $this->cId;
183
    }
184
185
    /*
186
    public function getResourceIdentifier(): int
187
    {
188
        return $this->getIid();
189
    }
190
191
    public function getResourceName(): string
192
    {
193
        return (string) $this->getIid();
194
    }
195
196
    public function setResourceName(string $name): self
197
    {
198
        //return $this->setTitle($name);
199
    }*/
200
}
201