Completed
Push — master ( db9c88...be5baf )
by Julito
14:58
created

CCourseDescription::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
 * CCourseDescription.
14
 *
15
 * @ORM\Table(name="c_course_description", indexes={@ORM\Index(name="session_id", columns={"session_id"})})
16
 * @ORM\Entity
17
 */
18
class CCourseDescription extends AbstractResource implements ResourceInterface
19
{
20
    public const TYPE_DESCRIPTION = 1;
21
    public const TYPE_OBJECTIVES = 2;
22
    public const TYPE_TOPICS = 3;
23
    public const TYPE_METHODOLOGY = 4;
24
    public const TYPE_COURSE_MATERIAL = 5;
25
    public const TYPE_RESOURCES = 6;
26
    public const TYPE_ASSESSMENT = 7;
27
    public const TYPE_CUSTOM = 8;
28
29
    /**
30
     * @var int
31
     *
32
     * @ORM\Column(name="iid", type="integer")
33
     * @ORM\Id
34
     * @ORM\GeneratedValue
35
     */
36
    protected $iid;
37
38
    /**
39
     * @var int
40
     *
41
     * @ORM\Column(name="c_id", type="integer")
42
     */
43
    protected $cId;
44
45
    /**
46
     * @var string
47
     *
48
     * @Assert\NotBlank
49
     *
50
     * @ORM\Column(name="title", type="text", nullable=true)
51
     */
52
    protected $title;
53
54
    /**
55
     * @var string
56
     *
57
     * @ORM\Column(name="content", type="text", nullable=true)
58
     */
59
    protected $content;
60
61
    /**
62
     * @var int
63
     *
64
     * @ORM\Column(name="session_id", type="integer", nullable=true)
65
     */
66
    protected $sessionId;
67
68
    /**
69
     * @var int
70
     *
71
     * @ORM\Column(name="description_type", type="integer", nullable=false)
72
     */
73
    protected $descriptionType;
74
75
    /**
76
     * @var int
77
     *
78
     * @ORM\Column(name="progress", type="integer", nullable=false)
79
     */
80
    protected $progress;
81
82
    /**
83
     * CCourseDescription constructor.
84
     */
85
    public function __construct()
86
    {
87
        $this->progress = 0;
88
        $this->descriptionType = 1;
89
    }
90
91
    public function __toString(): string
92
    {
93
        return $this->getTitle();
94
    }
95
96
    /**
97
     * Set title.
98
     *
99
     * @param string $title
100
     *
101
     * @return CCourseDescription
102
     */
103
    public function setTitle($title)
104
    {
105
        $this->title = $title;
106
107
        return $this;
108
    }
109
110
    /**
111
     * Get title.
112
     *
113
     * @return string
114
     */
115
    public function getTitle()
116
    {
117
        return $this->title;
118
    }
119
120
    /**
121
     * Set content.
122
     *
123
     * @param string $content
124
     *
125
     * @return CCourseDescription
126
     */
127
    public function setContent($content)
128
    {
129
        $this->content = $content;
130
131
        return $this;
132
    }
133
134
    /**
135
     * Get content.
136
     *
137
     * @return string
138
     */
139
    public function getContent()
140
    {
141
        return $this->content;
142
    }
143
144
    /**
145
     * Set sessionId.
146
     *
147
     * @param int $sessionId
148
     *
149
     * @return CCourseDescription
150
     */
151
    public function setSessionId($sessionId)
152
    {
153
        $this->sessionId = $sessionId;
154
155
        return $this;
156
    }
157
158
    /**
159
     * Get sessionId.
160
     *
161
     * @return int
162
     */
163
    public function getSessionId()
164
    {
165
        return $this->sessionId;
166
    }
167
168
    /**
169
     * Set descriptionType.
170
     *
171
     * @param int $descriptionType
172
     *
173
     * @return CCourseDescription
174
     */
175
    public function setDescriptionType($descriptionType)
176
    {
177
        $this->descriptionType = $descriptionType;
178
179
        return $this;
180
    }
181
182
    /**
183
     * Get descriptionType.
184
     *
185
     * @return int
186
     */
187
    public function getDescriptionType()
188
    {
189
        return $this->descriptionType;
190
    }
191
192
    /**
193
     * Set progress.
194
     *
195
     * @param int $progress
196
     *
197
     * @return CCourseDescription
198
     */
199
    public function setProgress($progress)
200
    {
201
        $this->progress = $progress;
202
203
        return $this;
204
    }
205
206
    /**
207
     * Get progress.
208
     *
209
     * @return int
210
     */
211
    public function getProgress()
212
    {
213
        return $this->progress;
214
    }
215
216
    /**
217
     * Set cId.
218
     *
219
     * @param int $cId
220
     *
221
     * @return CCourseDescription
222
     */
223
    public function setCId($cId)
224
    {
225
        $this->cId = $cId;
226
227
        return $this;
228
    }
229
230
    /**
231
     * Get cId.
232
     *
233
     * @return int
234
     */
235
    public function getCId()
236
    {
237
        return $this->cId;
238
    }
239
240
    /**
241
     * @return int
242
     */
243
    public function getIid()
244
    {
245
        return $this->iid;
246
    }
247
248
    /**
249
     * Resource identifier.
250
     */
251
    public function getResourceIdentifier(): int
252
    {
253
        return $this->getIid();
254
    }
255
256
    public function getResourceName(): string
257
    {
258
        return $this->getTitle();
259
    }
260
261
    public function setResourceName(string $name): self
262
    {
263
        return $this->setTitle($name);
264
    }
265
}
266