Passed
Push — master ( ab20b0...4728a8 )
by Julito
09:22
created

CBlog::setResourceName()   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 1
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\AbstractResource;
8
use Chamilo\CoreBundle\Entity\ResourceInterface;
9
use Doctrine\ORM\Mapping as ORM;
10
use Symfony\Component\Validator\Constraints as Assert;
11
12
/**
13
 * CBlog.
14
 *
15
 * @ORM\Table(
16
 *  name="c_blog",
17
 *  indexes={
18
 *      @ORM\Index(name="course", columns={"c_id"}),
19
 *      @ORM\Index(name="session_id", columns={"session_id"})
20
 *  }
21
 * )
22
 * @ORM\Entity
23
 */
24
class CBlog extends AbstractResource implements ResourceInterface
25
{
26
    /**
27
     * @var int
28
     *
29
     * @ORM\Column(name="iid", type="integer")
30
     * @ORM\Id
31
     * @ORM\GeneratedValue
32
     */
33
    protected $iid;
34
35
    /**
36
     * @var int
37
     *
38
     * @ORM\Column(name="c_id", type="integer")
39
     */
40
    protected $cId;
41
42
    /**
43
     * @var int
44
     *
45
     * @ORM\Column(name="blog_id", type="integer")
46
     */
47
    protected $blogId;
48
49
    /**
50
     * @var string
51
     * @Assert\NotBlank()
52
     * @ORM\Column(name="blog_name", type="string", length=250, nullable=false)
53
     */
54
    protected $blogName;
55
56
    /**
57
     * @var string
58
     *
59
     * @ORM\Column(name="blog_subtitle", type="string", length=250, nullable=true)
60
     */
61
    protected $blogSubtitle;
62
63
    /**
64
     * @var \DateTime
65
     *
66
     * @ORM\Column(name="date_creation", type="datetime", nullable=false)
67
     */
68
    protected $dateCreation;
69
70
    /**
71
     * @var bool
72
     *
73
     * @ORM\Column(name="visibility", type="boolean", nullable=false)
74
     */
75
    protected $visibility;
76
77
    /**
78
     * @var int
79
     *
80
     * @ORM\Column(name="session_id", type="integer", nullable=true)
81
     */
82
    protected $sessionId;
83
84
    /**
85
     * Set blogName.
86
     *
87
     * @param string $blogName
88
     *
89
     * @return CBlog
90
     */
91
    public function setBlogName($blogName)
92
    {
93
        $this->blogName = $blogName;
94
95
        return $this;
96
    }
97
98
    /**
99
     * Get blogName.
100
     *
101
     * @return string
102
     */
103
    public function getBlogName()
104
    {
105
        return $this->blogName;
106
    }
107
108
    /**
109
     * Set blogSubtitle.
110
     *
111
     * @param string $blogSubtitle
112
     *
113
     * @return CBlog
114
     */
115
    public function setBlogSubtitle($blogSubtitle)
116
    {
117
        $this->blogSubtitle = $blogSubtitle;
118
119
        return $this;
120
    }
121
122
    /**
123
     * Get blogSubtitle.
124
     *
125
     * @return string
126
     */
127
    public function getBlogSubtitle()
128
    {
129
        return $this->blogSubtitle;
130
    }
131
132
    /**
133
     * Set dateCreation.
134
     *
135
     * @param \DateTime $dateCreation
136
     *
137
     * @return CBlog
138
     */
139
    public function setDateCreation($dateCreation)
140
    {
141
        $this->dateCreation = $dateCreation;
142
143
        return $this;
144
    }
145
146
    /**
147
     * Get dateCreation.
148
     *
149
     * @return \DateTime
150
     */
151
    public function getDateCreation()
152
    {
153
        return $this->dateCreation;
154
    }
155
156
    /**
157
     * Set visibility.
158
     *
159
     * @param bool $visibility
160
     *
161
     * @return CBlog
162
     */
163
    public function setVisibility($visibility)
164
    {
165
        $this->visibility = $visibility;
166
167
        return $this;
168
    }
169
170
    /**
171
     * Get visibility.
172
     *
173
     * @return bool
174
     */
175
    public function getVisibility()
176
    {
177
        return $this->visibility;
178
    }
179
180
    /**
181
     * Set sessionId.
182
     *
183
     * @param int $sessionId
184
     *
185
     * @return CBlog
186
     */
187
    public function setSessionId($sessionId)
188
    {
189
        $this->sessionId = $sessionId;
190
191
        return $this;
192
    }
193
194
    /**
195
     * Get sessionId.
196
     *
197
     * @return int
198
     */
199
    public function getSessionId()
200
    {
201
        return $this->sessionId;
202
    }
203
204
    /**
205
     * Set blogId.
206
     *
207
     * @param int $blogId
208
     *
209
     * @return CBlog
210
     */
211
    public function setBlogId($blogId)
212
    {
213
        $this->blogId = $blogId;
214
215
        return $this;
216
    }
217
218
    /**
219
     * Get blogId.
220
     *
221
     * @return int
222
     */
223
    public function getBlogId()
224
    {
225
        return $this->blogId;
226
    }
227
228
    /**
229
     * Set cId.
230
     *
231
     * @param int $cId
232
     *
233
     * @return CBlog
234
     */
235
    public function setCId($cId)
236
    {
237
        $this->cId = $cId;
238
239
        return $this;
240
    }
241
242
    public function getIid(): int
243
    {
244
        return $this->iid;
245
    }
246
247
    /**
248
     * Get cId.
249
     *
250
     * @return int
251
     */
252
    public function getCId()
253
    {
254
        return $this->cId;
255
    }
256
257
    public function __toString(): string
258
    {
259
        return $this->getBlogName();
260
    }
261
262
    public function getResourceIdentifier(): int
263
    {
264
        return $this->getIid();
265
    }
266
267
    public function getResourceName(): string
268
    {
269
        return $this->getBlogName();
270
    }
271
272
    public function setResourceName(string $name): self
273
    {
274
        return $this->setBlogName($name);
275
    }
276
}
277