Passed
Push — master ( 4c4023...2b0e92 )
by Julito
07:08
created

CStudentPublicationAssignment::setCId()   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\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
 *     }
19
 * )
20
 * @ORM\Entity
21
 */
22
class CStudentPublicationAssignment
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="expires_on", type="datetime", nullable=true)
33
     */
34
    protected ?DateTime $expiresOn = null;
35
36
    /**
37
     * @ORM\Column(name="ends_on", type="datetime", nullable=true)
38
     */
39
    protected ?DateTime $endsOn = null;
40
41
    /**
42
     * @ORM\Column(name="add_to_calendar", type="integer", nullable=false)
43
     */
44
    protected bool $addToCalendar;
45
46
    /**
47
     * @ORM\Column(name="enable_qualification", type="boolean", nullable=false)
48
     */
49
    protected bool $enableQualification;
50
51
    /**
52
     * @ORM\OneToOne(targetEntity="CStudentPublication", inversedBy="assignment")
53
     * @ORM\JoinColumn(name="publication_id", referencedColumnName="iid", onDelete="CASCADE")
54
     */
55
    protected CStudentPublication $publication;
56
57
    public function __toString(): string
58
    {
59
        return (string) $this->getIid();
60
    }
61
62
    public function getIid(): int
63
    {
64
        return $this->iid;
65
    }
66
67
    public function setExpiresOn(DateTime $expiresOn): self
68
    {
69
        $this->expiresOn = $expiresOn;
70
71
        return $this;
72
    }
73
74
    public function getExpiresOn(): ?DateTime
75
    {
76
        return $this->expiresOn;
77
    }
78
79
    public function setEndsOn(DateTime $endsOn): self
80
    {
81
        $this->endsOn = $endsOn;
82
83
        return $this;
84
    }
85
86
    public function getEndsOn(): ?DateTime
87
    {
88
        return $this->endsOn;
89
    }
90
91
    public function setAddToCalendar(bool $addToCalendar): self
92
    {
93
        $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...
94
95
        return $this;
96
    }
97
98
    public function getAddToCalendar(): bool
99
    {
100
        return $this->addToCalendar;
101
    }
102
103
    public function setEnableQualification(bool $enableQualification): self
104
    {
105
        $this->enableQualification = $enableQualification;
106
107
        return $this;
108
    }
109
110
    public function getEnableQualification(): bool
111
    {
112
        return $this->enableQualification;
113
    }
114
115
    /*
116
    public function getResourceIdentifier(): int
117
    {
118
        return $this->getIid();
119
    }
120
121
    public function getResourceName(): string
122
    {
123
        return (string) $this->getIid();
124
    }
125
126
    public function setResourceName(string $name): self
127
    {
128
        //return $this->setTitle($name);
129
    }*/
130
}
131