Passed
Push — master ( 7ade69...469b77 )
by Julito
11:15
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")
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 string
40
     *
41
     * @Assert\NotBlank
42
     *
43
     * @ORM\Column(name="title", type="text", nullable=true)
44
     */
45
    protected $title;
46
47
    /**
48
     * @var string
49
     *
50
     * @ORM\Column(name="content", type="text", nullable=true)
51
     */
52
    protected $content;
53
54
    /**
55
     * @var int
56
     *
57
     * @ORM\Column(name="description_type", type="integer", nullable=false)
58
     */
59
    protected $descriptionType;
60
61
    /**
62
     * @var int
63
     *
64
     * @ORM\Column(name="progress", type="integer", nullable=false)
65
     */
66
    protected $progress;
67
68
    /**
69
     * CCourseDescription constructor.
70
     */
71
    public function __construct()
72
    {
73
        $this->progress = 0;
74
        $this->descriptionType = 1;
75
    }
76
77
    public function __toString(): string
78
    {
79
        return $this->getTitle();
80
    }
81
82
    /**
83
     * Set title.
84
     *
85
     * @param string $title
86
     *
87
     * @return CCourseDescription
88
     */
89
    public function setTitle($title)
90
    {
91
        $this->title = $title;
92
93
        return $this;
94
    }
95
96
    /**
97
     * Get title.
98
     *
99
     * @return string
100
     */
101
    public function getTitle()
102
    {
103
        return $this->title;
104
    }
105
106
    /**
107
     * Set content.
108
     *
109
     * @param string $content
110
     *
111
     * @return CCourseDescription
112
     */
113
    public function setContent($content)
114
    {
115
        $this->content = $content;
116
117
        return $this;
118
    }
119
120
    /**
121
     * Get content.
122
     *
123
     * @return string
124
     */
125
    public function getContent()
126
    {
127
        return $this->content;
128
    }
129
130
    /**
131
     * Set descriptionType.
132
     *
133
     * @param int $descriptionType
134
     *
135
     * @return CCourseDescription
136
     */
137
    public function setDescriptionType($descriptionType)
138
    {
139
        $this->descriptionType = $descriptionType;
140
141
        return $this;
142
    }
143
144
    /**
145
     * Get descriptionType.
146
     *
147
     * @return int
148
     */
149
    public function getDescriptionType()
150
    {
151
        return $this->descriptionType;
152
    }
153
154
    /**
155
     * Set progress.
156
     *
157
     * @param int $progress
158
     *
159
     * @return CCourseDescription
160
     */
161
    public function setProgress($progress)
162
    {
163
        $this->progress = $progress;
164
165
        return $this;
166
    }
167
168
    /**
169
     * Get progress.
170
     *
171
     * @return int
172
     */
173
    public function getProgress()
174
    {
175
        return $this->progress;
176
    }
177
178
    /**
179
     * @return int
180
     */
181
    public function getIid()
182
    {
183
        return $this->iid;
184
    }
185
186
    /**
187
     * Resource identifier.
188
     */
189
    public function getResourceIdentifier(): int
190
    {
191
        return $this->getIid();
192
    }
193
194
    public function getResourceName(): string
195
    {
196
        return $this->getTitle();
197
    }
198
199
    public function setResourceName(string $name): self
200
    {
201
        return $this->setTitle($name);
202
    }
203
}
204