Passed
Push — master ( 4ca170...784f70 )
by Julito
12:58
created

CThematicPlan::getThematic()   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\Resource\AbstractResource;
8
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
9
use Doctrine\ORM\Mapping as ORM;
10
11
/**
12
 * CThematicPlan.
13
 *
14
 * @ORM\Table(
15
 *  name="c_thematic_plan",
16
 *  indexes={
17
 *      @ORM\Index(name="course", columns={"c_id"}),
18
 *      @ORM\Index(name="thematic_id", columns={"thematic_id", "description_type"})
19
 *  }
20
 * )
21
 * @ORM\Entity
22
 */
23
class CThematicPlan 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="c_id", type="integer")
38
     */
39
    protected $cId;
40
41
    /**
42
     * @var int
43
     *
44
     * @ORM\Column(name="id", type="integer", nullable=true)
45
     */
46
    protected $id;
47
48
    /**
49
     * @var CThematic
50
     *
51
     * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CThematic")
52
     * @ORM\JoinColumn(name="thematic_id", referencedColumnName="iid")
53
     */
54
    protected $thematic;
55
56
    /**
57
     * @var string
58
     *
59
     * @ORM\Column(name="title", type="string", length=255, nullable=false)
60
     */
61
    protected $title;
62
63
    /**
64
     * @var string
65
     *
66
     * @ORM\Column(name="description", type="text", nullable=true)
67
     */
68
    protected $description;
69
70
    /**
71
     * @var int
72
     *
73
     * @ORM\Column(name="description_type", type="integer", nullable=false)
74
     */
75
    protected $descriptionType;
76
77
    /**
78
     * Set thematicId.
79
     *
80
     * @param int $thematicId
81
     *
82
     * @return CThematicPlan
83
     */
84
    public function setThematicId($thematicId)
85
    {
86
        $this->thematicId = $thematicId;
0 ignored issues
show
Bug Best Practice introduced by
The property thematicId does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
87
88
        return $this;
89
    }
90
91
    /**
92
     * Get thematicId.
93
     *
94
     * @return int
95
     */
96
    public function getThematicId()
97
    {
98
        return $this->thematicId;
99
    }
100
101
    /**
102
     * Set title.
103
     *
104
     * @param string $title
105
     *
106
     * @return CThematicPlan
107
     */
108
    public function setTitle($title)
109
    {
110
        $this->title = $title;
111
112
        return $this;
113
    }
114
115
    /**
116
     * Get title.
117
     *
118
     * @return string
119
     */
120
    public function getTitle()
121
    {
122
        return $this->title;
123
    }
124
125
    /**
126
     * Set description.
127
     *
128
     * @param string $description
129
     *
130
     * @return CThematicPlan
131
     */
132
    public function setDescription($description)
133
    {
134
        $this->description = $description;
135
136
        return $this;
137
    }
138
139
    /**
140
     * Get description.
141
     *
142
     * @return string
143
     */
144
    public function getDescription()
145
    {
146
        return $this->description;
147
    }
148
149
    /**
150
     * Set descriptionType.
151
     *
152
     * @param int $descriptionType
153
     *
154
     * @return CThematicPlan
155
     */
156
    public function setDescriptionType($descriptionType)
157
    {
158
        $this->descriptionType = $descriptionType;
159
160
        return $this;
161
    }
162
163
    /**
164
     * Get descriptionType.
165
     *
166
     * @return int
167
     */
168
    public function getDescriptionType()
169
    {
170
        return $this->descriptionType;
171
    }
172
173
    /**
174
     * Set id.
175
     *
176
     * @param int $id
177
     *
178
     * @return CThematicPlan
179
     */
180
    public function setId($id)
181
    {
182
        $this->id = $id;
183
184
        return $this;
185
    }
186
187
    /**
188
     * Get id.
189
     *
190
     * @return int
191
     */
192
    public function getId()
193
    {
194
        return $this->id;
195
    }
196
197
    /**
198
     * Set cId.
199
     *
200
     * @param int $cId
201
     *
202
     * @return CThematicPlan
203
     */
204
    public function setCId($cId)
205
    {
206
        $this->cId = $cId;
207
208
        return $this;
209
    }
210
211
    /**
212
     * Get cId.
213
     *
214
     * @return int
215
     */
216
    public function getCId()
217
    {
218
        return $this->cId;
219
    }
220
221
    public function __toString(): string
222
    {
223
        return (string) $this->getIid();
224
    }
225
226
    public function getIid(): int
227
    {
228
        return $this->iid;
229
    }
230
231
    public function getThematic(): CThematic
232
    {
233
        return $this->thematic;
234
    }
235
236
    public function setThematic(CThematic $thematic): self
237
    {
238
        $this->thematic = $thematic;
239
240
        return $this;
241
    }
242
243
    /**
244
     * Resource identifier.
245
     */
246
    public function getResourceIdentifier(): int
247
    {
248
        return $this->getIid();
249
    }
250
251
    public function getResourceName(): string
252
    {
253
        return $this->getTitle();
254
    }
255
}
256