Completed
Push — master ( f75b34...c65fe1 )
by Julito
11:42
created

CThematicPlan::getId()   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
 * 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 CThematic
43
     *
44
     * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CThematic", inversedBy="plans")
45
     * @ORM\JoinColumn(name="thematic_id", referencedColumnName="iid")
46
     */
47
    protected $thematic;
48
49
    /**
50
     * @var string
51
     *
52
     * @ORM\Column(name="title", type="string", length=255, nullable=false)
53
     */
54
    protected $title;
55
56
    /**
57
     * @var string
58
     *
59
     * @ORM\Column(name="description", type="text", nullable=true)
60
     */
61
    protected $description;
62
63
    /**
64
     * @var int
65
     *
66
     * @ORM\Column(name="description_type", type="integer", nullable=false)
67
     */
68
    protected $descriptionType;
69
70
    public function __toString(): string
71
    {
72
        return (string) $this->getIid();
73
    }
74
75
    /**
76
     * Set thematicId.
77
     *
78
     * @param int $thematicId
79
     *
80
     * @return CThematicPlan
81
     */
82
    public function setThematicId($thematicId)
83
    {
84
        $this->thematicId = $thematicId;
85
86
        return $this;
87
    }
88
89
    /**
90
     * Get thematicId.
91
     *
92
     * @return int
93
     */
94
    public function getThematicId()
95
    {
96
        return $this->thematicId;
97
    }
98
99
    /**
100
     * Set title.
101
     *
102
     * @param string $title
103
     *
104
     * @return CThematicPlan
105
     */
106
    public function setTitle($title)
107
    {
108
        $this->title = $title;
109
110
        return $this;
111
    }
112
113
    /**
114
     * Get title.
115
     *
116
     * @return string
117
     */
118
    public function getTitle()
119
    {
120
        return $this->title;
121
    }
122
123
    /**
124
     * Set description.
125
     *
126
     * @param string $description
127
     *
128
     * @return CThematicPlan
129
     */
130
    public function setDescription($description)
131
    {
132
        $this->description = $description;
133
134
        return $this;
135
    }
136
137
    /**
138
     * Get description.
139
     *
140
     * @return string
141
     */
142
    public function getDescription()
143
    {
144
        return $this->description;
145
    }
146
147
    /**
148
     * Set descriptionType.
149
     *
150
     * @param int $descriptionType
151
     *
152
     * @return CThematicPlan
153
     */
154
    public function setDescriptionType($descriptionType)
155
    {
156
        $this->descriptionType = $descriptionType;
157
158
        return $this;
159
    }
160
161
    /**
162
     * Get descriptionType.
163
     *
164
     * @return int
165
     */
166
    public function getDescriptionType()
167
    {
168
        return $this->descriptionType;
169
    }
170
171
    /**
172
     * Set cId.
173
     *
174
     * @param int $cId
175
     *
176
     * @return CThematicPlan
177
     */
178
    public function setCId($cId)
179
    {
180
        $this->cId = $cId;
181
182
        return $this;
183
    }
184
185
    /**
186
     * Get cId.
187
     *
188
     * @return int
189
     */
190
    public function getCId()
191
    {
192
        return $this->cId;
193
    }
194
195
    public function getIid(): int
196
    {
197
        return $this->iid;
198
    }
199
200
    public function getThematic(): CThematic
201
    {
202
        return $this->thematic;
203
    }
204
205
    public function setThematic(CThematic $thematic): self
206
    {
207
        $this->thematic = $thematic;
208
209
        return $this;
210
    }
211
212
    /**
213
     * Resource identifier.
214
     */
215
    public function getResourceIdentifier(): int
216
    {
217
        return $this->getIid();
218
    }
219
220
    public function getResourceName(): string
221
    {
222
        return $this->getTitle();
223
    }
224
}
225