Passed
Push — master ( cc68cc...50453a )
by Julito
09:11
created

CCalendarEventAttachment::getCId()   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
/* 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 Doctrine\ORM\Mapping as ORM;
10
11
/**
12
 * CCalendarEventAttachment.
13
 *
14
 * @ORM\Table(
15
 *  name="c_calendar_event_attachment",
16
 *  indexes={
17
 *  }
18
 * )
19
 * @ORM\Entity
20
 */
21
class CCalendarEventAttachment extends AbstractResource implements ResourceInterface
22
{
23
    /**
24
     * @var int
25
     *
26
     * @ORM\Column(name="iid", type="integer")
27
     * @ORM\Id
28
     * @ORM\GeneratedValue
29
     */
30
    protected $iid;
31
32
    /**
33
     * @var string
34
     *
35
     * @ORM\Column(name="path", type="string", length=255, nullable=false)
36
     */
37
    protected $path;
38
39
    /**
40
     * @var string
41
     *
42
     * @ORM\Column(name="comment", type="text", nullable=true)
43
     */
44
    protected $comment;
45
46
    /**
47
     * @var int
48
     *
49
     * @ORM\Column(name="size", type="integer", nullable=false)
50
     */
51
    protected $size;
52
53
    /**
54
     * @var string
55
     *
56
     * @ORM\Column(name="filename", type="string", length=255, nullable=false)
57
     */
58
    protected $filename;
59
60
    /**
61
     * @var CCalendarEvent
62
     *
63
     * @ORM\ManyToOne(targetEntity="CCalendarEvent", cascade={"persist"}, inversedBy="attachments")
64
     * @ORM\JoinColumn(name="agenda_id", referencedColumnName="iid", onDelete="CASCADE")
65
     */
66
    protected $event;
67
68
    public function __toString(): string
69
    {
70
        return $this->getFilename();
71
    }
72
73
    /**
74
     * Set path.
75
     *
76
     * @param string $path
77
     */
78
    public function setPath($path): self
79
    {
80
        $this->path = $path;
81
82
        return $this;
83
    }
84
85
    /**
86
     * Get path.
87
     *
88
     * @return string
89
     */
90
    public function getPath()
91
    {
92
        return $this->path;
93
    }
94
95
    /**
96
     * Set comment.
97
     *
98
     * @param string $comment
99
     */
100
    public function setComment($comment): self
101
    {
102
        $this->comment = $comment;
103
104
        return $this;
105
    }
106
107
    /**
108
     * Get comment.
109
     *
110
     * @return string
111
     */
112
    public function getComment()
113
    {
114
        return $this->comment;
115
    }
116
117
    /**
118
     * Set size.
119
     *
120
     * @param int $size
121
     *
122
     * @return CCalendarEventAttachment
123
     */
124
    public function setSize($size)
125
    {
126
        $this->size = $size;
127
128
        return $this;
129
    }
130
131
    /**
132
     * Get size.
133
     *
134
     * @return int
135
     */
136
    public function getSize()
137
    {
138
        return $this->size;
139
    }
140
141
    /**
142
     * Set filename.
143
     *
144
     * @param string $filename
145
     *
146
     * @return CCalendarEventAttachment
147
     */
148
    public function setFilename($filename)
149
    {
150
        $this->filename = $filename;
151
152
        return $this;
153
    }
154
155
    /**
156
     * Get filename.
157
     *
158
     * @return string
159
     */
160
    public function getFilename()
161
    {
162
        return $this->filename;
163
    }
164
165
    /**
166
     * @return int
167
     */
168
    public function getIid()
169
    {
170
        return $this->iid;
171
    }
172
173
    public function getEvent(): CCalendarEvent
174
    {
175
        return $this->event;
176
    }
177
178
    /**
179
     * @return CCalendarEventAttachment
180
     */
181
    public function setEvent(CCalendarEvent $event): self
182
    {
183
        $this->event = $event;
184
185
        return $this;
186
    }
187
188
    /**
189
     * Resource identifier.
190
     */
191
    public function getResourceIdentifier(): int
192
    {
193
        return $this->getIid();
194
    }
195
196
    public function getResourceName(): string
197
    {
198
        return $this->getFilename();
199
    }
200
201
    public function setResourceName(string $name): self
202
    {
203
        return $this->setFilename($name);
204
    }
205
}
206