Passed
Push — master ( 0334ca...02c608 )
by Julito
10:30
created

CAnnouncement::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
/* For licensing terms, see /license.txt */
4
5
namespace Chamilo\CourseBundle\Entity;
6
7
use Chamilo\CoreBundle\Entity\AbstractResource;
8
use Chamilo\CoreBundle\Entity\ResourceInterface;
9
use Chamilo\CoreBundle\Entity\ResourceToCourseInterface;
10
use Doctrine\ORM\Mapping as ORM;
11
12
/**
13
 * CAnnouncement.
14
 *
15
 * @ORM\Table(name="c_announcement")
16
 * @ORM\Entity
17
 */
18
class CAnnouncement extends AbstractResource implements ResourceInterface, ResourceToCourseInterface
19
{
20
    /**
21
     * @var int
22
     *
23
     * @ORM\Column(name="iid", type="integer")
24
     * @ORM\Id
25
     * @ORM\GeneratedValue
26
     */
27
    protected $iid;
28
29
    /**
30
     * @var string
31
     *
32
     * @ORM\Column(name="title", type="text", nullable=true)
33
     */
34
    protected $title;
35
36
    /**
37
     * @var string
38
     *
39
     * @ORM\Column(name="content", type="text", nullable=true)
40
     */
41
    protected $content;
42
43
    /**
44
     * @var \DateTime
45
     *
46
     * @ORM\Column(name="end_date", type="date", nullable=true)
47
     */
48
    protected $endDate;
49
50
    /**
51
     * @var int
52
     *
53
     * @ORM\Column(name="display_order", type="integer", nullable=false)
54
     */
55
    protected $displayOrder;
56
57
    /**
58
     * @var bool
59
     *
60
     * @ORM\Column(name="email_sent", type="boolean", nullable=true)
61
     */
62
    protected $emailSent;
63
64
    /**
65
     * @var CAnnouncementAttachment[]
66
     *
67
     * @ORM\OneToMany(targetEntity="Chamilo\CourseBundle\Entity\CAnnouncementAttachment", mappedBy="announcement", cascade={"persist", "remove"}, orphanRemoval=true)
68
     */
69
    protected $attachments;
70
71
    public function __toString(): string
72
    {
73
        return $this->getTitle();
74
    }
75
76
    /**
77
     * @return CAnnouncementAttachment[]
78
     */
79
    public function getAttachments()
80
    {
81
        return $this->attachments;
82
    }
83
84
    /**
85
     * @param CAnnouncementAttachment[] $attachments
86
     */
87
    public function setAttachments(array $attachments): self
88
    {
89
        $this->attachments = $attachments;
90
91
        return $this;
92
    }
93
94
    /**
95
     * Set title.
96
     *
97
     * @param string $title
98
     *
99
     * @return CAnnouncement
100
     */
101
    public function setTitle($title)
102
    {
103
        $this->title = $title;
104
105
        return $this;
106
    }
107
108
    /**
109
     * Get title.
110
     *
111
     * @return string
112
     */
113
    public function getTitle()
114
    {
115
        return (string) $this->title;
116
    }
117
118
    /**
119
     * Set content.
120
     *
121
     * @param string $content
122
     *
123
     * @return CAnnouncement
124
     */
125
    public function setContent($content)
126
    {
127
        $this->content = $content;
128
129
        return $this;
130
    }
131
132
    /**
133
     * Get content.
134
     *
135
     * @return string
136
     */
137
    public function getContent()
138
    {
139
        return $this->content;
140
    }
141
142
    /**
143
     * Set endDate.
144
     *
145
     * @param \DateTime $endDate
146
     *
147
     * @return CAnnouncement
148
     */
149
    public function setEndDate($endDate)
150
    {
151
        $this->endDate = $endDate;
152
153
        return $this;
154
    }
155
156
    /**
157
     * Get endDate.
158
     *
159
     * @return \DateTime
160
     */
161
    public function getEndDate()
162
    {
163
        return $this->endDate;
164
    }
165
166
    /**
167
     * Set displayOrder.
168
     *
169
     * @param int $displayOrder
170
     *
171
     * @return CAnnouncement
172
     */
173
    public function setDisplayOrder($displayOrder)
174
    {
175
        $this->displayOrder = $displayOrder;
176
177
        return $this;
178
    }
179
180
    /**
181
     * Get displayOrder.
182
     *
183
     * @return int
184
     */
185
    public function getDisplayOrder()
186
    {
187
        return $this->displayOrder;
188
    }
189
190
    /**
191
     * Set emailSent.
192
     *
193
     * @param bool $emailSent
194
     *
195
     * @return CAnnouncement
196
     */
197
    public function setEmailSent($emailSent)
198
    {
199
        $this->emailSent = $emailSent;
200
201
        return $this;
202
    }
203
204
    /**
205
     * Get emailSent.
206
     *
207
     * @return bool
208
     */
209
    public function getEmailSent()
210
    {
211
        return $this->emailSent;
212
    }
213
214
    public function getIid(): int
215
    {
216
        return $this->iid;
217
    }
218
219
    /**
220
     * Resource identifier.
221
     */
222
    public function getResourceIdentifier(): int
223
    {
224
        return $this->getIid();
225
    }
226
227
    public function getResourceName(): string
228
    {
229
        return $this->getTitle();
230
    }
231
}
232