Passed
Push — master ( cb50ee...221dc3 )
by Julito
07:56
created

CThematicPlan::setThematicId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
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
use Symfony\Component\Validator\Constraints as Assert;
11
12
/**
13
 * CThematicPlan.
14
 *
15
 * @ORM\Table(
16
 *  name="c_thematic_plan",
17
 *  indexes={
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
     * @Assert\NotBlank()
36
     *
37
     * @ORM\Column(name="title", type="string", length=255, nullable=false)
38
     */
39
    protected string $title;
40
41
    /**
42
     * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CThematic", inversedBy="plans")
43
     * @ORM\JoinColumn(name="thematic_id", referencedColumnName="iid")
44
     */
45
    protected CThematic $thematic;
46
47
    /**
48
     * @ORM\Column(name="description", type="text", nullable=true)
49
     */
50
    protected ?string $description;
51
52
    /**
53
     * @ORM\Column(name="description_type", type="integer", nullable=false)
54
     */
55
    protected int $descriptionType;
56
57
    public function __toString(): string
58
    {
59
        return (string) $this->getIid();
60
    }
61
62
    /**
63
     * Set title.
64
     *
65
     * @param string $title
66
     */
67
    public function setTitle($title): self
68
    {
69
        $this->title = $title;
70
71
        return $this;
72
    }
73
74
    /**
75
     * Get title.
76
     *
77
     * @return string
78
     */
79
    public function getTitle()
80
    {
81
        return $this->title;
82
    }
83
84
    /**
85
     * Set description.
86
     */
87
    public function setDescription(?string $description): self
88
    {
89
        $this->description = $description;
90
91
        return $this;
92
    }
93
94
    /**
95
     * Get description.
96
     */
97
    public function getDescription(): ?string
98
    {
99
        return $this->description;
100
    }
101
102
    /**
103
     * Set descriptionType.
104
     */
105
    public function setDescriptionType(int $descriptionType): self
106
    {
107
        $this->descriptionType = $descriptionType;
108
109
        return $this;
110
    }
111
112
    /**
113
     * Get descriptionType.
114
     */
115
    public function getDescriptionType(): int
116
    {
117
        return $this->descriptionType;
118
    }
119
120
    public function getIid(): int
121
    {
122
        return $this->iid;
123
    }
124
125
    public function getThematic(): CThematic
126
    {
127
        return $this->thematic;
128
    }
129
130
    public function setThematic(CThematic $thematic): self
131
    {
132
        $this->thematic = $thematic;
133
134
        return $this;
135
    }
136
137
    /*
138
    public function getResourceIdentifier(): int
139
    {
140
        return $this->getIid();
141
    }
142
143
    public function getResourceName(): string
144
    {
145
        return $this->getTitle();
146
    }
147
148
    public function setResourceName(string $name): self
149
    {
150
        return $this->setTitle($name);
151
    }*/
152
}
153