1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* For licensing terms, see /license.txt */ |
6
|
|
|
|
7
|
|
|
namespace Chamilo\CoreBundle\Entity; |
8
|
|
|
|
9
|
|
|
use Doctrine\ORM\Mapping as ORM; |
10
|
|
|
use Gedmo\Mapping\Annotation as Gedmo; |
11
|
|
|
use Stringable; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* Skill level. |
15
|
|
|
*/ |
16
|
|
|
#[ORM\Table(name: 'skill_level')] |
17
|
|
|
#[ORM\Entity] |
18
|
|
|
class Level implements Stringable |
19
|
|
|
{ |
20
|
|
|
#[ORM\Column(name: 'id', type: 'integer')] |
21
|
|
|
#[ORM\Id] |
22
|
|
|
#[ORM\GeneratedValue] |
23
|
|
|
protected ?int $id = null; |
24
|
|
|
|
25
|
|
|
#[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] |
26
|
|
|
protected string $title; |
27
|
|
|
|
28
|
|
|
#[Gedmo\SortablePosition] |
29
|
|
|
#[ORM\Column(name: 'position', type: 'integer')] |
30
|
|
|
protected int $position; |
31
|
|
|
|
32
|
|
|
#[ORM\Column(name: 'short_title', type: 'string', length: 255, nullable: false)] |
33
|
|
|
protected string $shortTitle; |
34
|
|
|
|
35
|
|
|
#[Gedmo\SortableGroup] |
36
|
|
|
#[ORM\ManyToOne(targetEntity: Profile::class, inversedBy: 'levels')] |
37
|
|
|
#[ORM\JoinColumn(name: 'profile_id', referencedColumnName: 'id')] |
38
|
|
|
protected ?Profile $profile = null; |
39
|
|
|
|
40
|
|
|
public function __toString(): string |
41
|
|
|
{ |
42
|
|
|
return $this->getTitle(); |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @return int |
47
|
|
|
*/ |
48
|
|
|
public function getId() |
49
|
|
|
{ |
50
|
|
|
return $this->id; |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @return string |
55
|
|
|
*/ |
56
|
|
|
public function getTitle() |
57
|
|
|
{ |
58
|
|
|
return $this->title; |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
public function setTitle(string $title): self |
62
|
|
|
{ |
63
|
|
|
$this->title = $title; |
64
|
|
|
|
65
|
|
|
return $this; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
public function getPosition(): int |
69
|
|
|
{ |
70
|
|
|
return $this->position; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
public function setPosition(int $position): self |
74
|
|
|
{ |
75
|
|
|
$this->position = $position; |
76
|
|
|
|
77
|
|
|
return $this; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
public function getShortTitle(): string |
81
|
|
|
{ |
82
|
|
|
return $this->shortTitle; |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
public function setShortTitle(string $shortTitle): self |
86
|
|
|
{ |
87
|
|
|
$this->shortTitle = $shortTitle; |
88
|
|
|
|
89
|
|
|
return $this; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* @return Profile |
94
|
|
|
*/ |
95
|
|
|
public function getProfile() |
96
|
|
|
{ |
97
|
|
|
return $this->profile; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
public function setProfile(Profile $profile): self |
101
|
|
|
{ |
102
|
|
|
$this->profile = $profile; |
103
|
|
|
|
104
|
|
|
return $this; |
105
|
|
|
} |
106
|
|
|
} |
107
|
|
|
|