Passed
Push — master ( 43f231...6078d3 )
by Julito
08:55
created

CCalendarEventAttachment::getEvent()   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
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
namespace Chamilo\CourseBundle\Entity;
6
7
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
8
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
9
use Chamilo\CoreBundle\Entity\Room;
10
use Doctrine\ORM\Mapping as ORM;
11
12
/**
13
 * CCalendarEventAttachment.
14
 *
15
 * @ORM\Table(
16
 *  name="c_calendar_event_attachment",
17
 *  indexes={
18
 *      @ORM\Index(name="course", columns={"c_id"})
19
 *  }
20
 * )
21
 * @ORM\Entity
22
 */
23
class CCalendarEventAttachment extends AbstractResource implements ResourceInterface
24
{
25
    /**
26
     * @var int
27
     *
28
     * @ORM\Column(name="iid", type="integer")
29
     * @ORM\Id
30
     * @ORM\GeneratedValue
31
     */
32
    protected $iid;
33
34
    /**
35
     * @var int
36
     *
37
     * @ORM\Column(name="id", type="integer", nullable=true)
38
     */
39
    protected $id;
40
41
    /**
42
     * @var int
43
     *
44
     * @ORM\Column(name="c_id", type="integer")
45
     */
46
    protected $cId;
47
48
    /**
49
     * @var string
50
     *
51
     * @ORM\Column(name="path", type="string", length=255, nullable=false)
52
     */
53
    protected $path;
54
55
    /**
56
     * @var string
57
     *
58
     * @ORM\Column(name="comment", type="text", nullable=true)
59
     */
60
    protected $comment;
61
62
    /**
63
     * @var int
64
     *
65
     * @ORM\Column(name="size", type="integer", nullable=false)
66
     */
67
    protected $size;
68
69
    /**
70
     * @var string
71
     *
72
     * @ORM\Column(name="filename", type="string", length=255, nullable=false)
73
     */
74
    protected $filename;
75
76
    /**
77
     * @var CCalendarEvent
78
     *
79
     * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CCalendarEvent", cascade={"persist"}, inversedBy="attachments")
80
     * @ORM\JoinColumn(name="agenda_id", referencedColumnName="iid", onDelete="CASCADE")
81
     */
82
    protected $event;
83
84
    /**
85
     * Set path.
86
     *
87
     * @param string $path
88
     *
89
     * @return CCalendarEventAttachment
90
     */
91
    public function setPath($path)
92
    {
93
        $this->path = $path;
94
95
        return $this;
96
    }
97
98
    /**
99
     * Get path.
100
     *
101
     * @return string
102
     */
103
    public function getPath()
104
    {
105
        return $this->path;
106
    }
107
108
    /**
109
     * Set comment.
110
     *
111
     * @param string $comment
112
     *
113
     * @return CCalendarEventAttachment
114
     */
115
    public function setComment($comment)
116
    {
117
        $this->comment = $comment;
118
119
        return $this;
120
    }
121
122
    /**
123
     * Get comment.
124
     *
125
     * @return string
126
     */
127
    public function getComment()
128
    {
129
        return $this->comment;
130
    }
131
132
    /**
133
     * Set size.
134
     *
135
     * @param int $size
136
     *
137
     * @return CCalendarEventAttachment
138
     */
139
    public function setSize($size)
140
    {
141
        $this->size = $size;
142
143
        return $this;
144
    }
145
146
    /**
147
     * Get size.
148
     *
149
     * @return int
150
     */
151
    public function getSize()
152
    {
153
        return $this->size;
154
    }
155
156
    /**
157
     * Set filename.
158
     *
159
     * @param string $filename
160
     *
161
     * @return CCalendarEventAttachment
162
     */
163
    public function setFilename($filename)
164
    {
165
        $this->filename = $filename;
166
167
        return $this;
168
    }
169
170
    /**
171
     * Get filename.
172
     *
173
     * @return string
174
     */
175
    public function getFilename()
176
    {
177
        return $this->filename;
178
    }
179
180
    /**
181
     * Set id.
182
     *
183
     * @param int $id
184
     *
185
     * @return CCalendarEventAttachment
186
     */
187
    public function setId($id)
188
    {
189
        $this->id = $id;
190
191
        return $this;
192
    }
193
194
    /**
195
     * Get id.
196
     *
197
     * @return int
198
     */
199
    public function getId()
200
    {
201
        return $this->id;
202
    }
203
204
    /**
205
     * Set cId.
206
     *
207
     * @param int $cId
208
     *
209
     * @return CCalendarEventAttachment
210
     */
211
    public function setCId($cId)
212
    {
213
        $this->cId = $cId;
214
215
        return $this;
216
    }
217
218
    /**
219
     * Get cId.
220
     *
221
     * @return int
222
     */
223
    public function getCId()
224
    {
225
        return $this->cId;
226
    }
227
228
    /**
229
     * @return int
230
     */
231
    public function getIid()
232
    {
233
        return $this->iid;
234
    }
235
236
    /**
237
     * @return CCalendarEvent
238
     */
239
    public function getEvent(): CCalendarEvent
240
    {
241
        return $this->event;
242
    }
243
244
    /**
245
     * @param CCalendarEvent $event
246
     *
247
     * @return CCalendarEventAttachment
248
     */
249
    public function setEvent(CCalendarEvent $event): self
250
    {
251
        $this->event = $event;
252
253
        return $this;
254
    }
255
256
    public function __toString(): string
257
    {
258
        return $this->getFilename();
259
    }
260
261
    /**
262
     * Resource identifier.
263
     */
264
    public function getResourceIdentifier(): int
265
    {
266
        return $this->getIid();
267
    }
268
269
    public function getResourceName(): string
270
    {
271
        return $this->getFilename();
272
    }
273
}
274