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\Common\Collections\ArrayCollection; |
10
|
|
|
use Doctrine\Common\Collections\Collection; |
11
|
|
|
use Doctrine\ORM\Mapping as ORM; |
12
|
|
|
use Stringable; |
13
|
|
|
|
14
|
|
|
#[ORM\Table(name: 'skill_level_profile')] |
15
|
|
|
#[ORM\Entity] |
16
|
|
|
class SkillLevelProfile implements Stringable |
17
|
|
|
{ |
18
|
|
|
#[ORM\Column(name: 'id', type: 'integer')] |
19
|
|
|
#[ORM\Id] |
20
|
|
|
#[ORM\GeneratedValue] |
21
|
|
|
protected ?int $id = null; |
22
|
|
|
|
23
|
|
|
#[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] |
24
|
|
|
protected string $title; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @var Collection<int, Skill> |
28
|
|
|
*/ |
29
|
|
|
#[ORM\OneToMany(mappedBy: 'levelProfile', targetEntity: Skill::class, cascade: ['persist'])] |
30
|
|
|
protected Collection $skills; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @var Collection<int, Level> |
34
|
|
|
*/ |
35
|
|
|
#[ORM\OneToMany(mappedBy: 'profile', targetEntity: Level::class, cascade: ['persist'])] |
36
|
|
|
#[ORM\OrderBy(['position' => 'ASC'])] |
37
|
|
|
protected Collection $levels; |
38
|
|
|
|
39
|
|
|
public function __construct() |
40
|
|
|
{ |
41
|
|
|
$this->skills = new ArrayCollection(); |
42
|
|
|
$this->levels = new ArrayCollection(); |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
public function __toString(): string |
46
|
|
|
{ |
47
|
|
|
return $this->getTitle(); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @return int |
52
|
|
|
*/ |
53
|
|
|
public function getId() |
54
|
|
|
{ |
55
|
|
|
return $this->id; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
public function getTitle(): string |
59
|
|
|
{ |
60
|
|
|
return $this->title; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
public function setTitle(string $title): self |
64
|
|
|
{ |
65
|
|
|
$this->title = $title; |
66
|
|
|
|
67
|
|
|
return $this; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @return Skill[]|Collection |
72
|
|
|
*/ |
73
|
|
|
public function getSkills(): array|Collection |
74
|
|
|
{ |
75
|
|
|
return $this->skills; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @param Skill[]|Collection $skills |
80
|
|
|
*/ |
81
|
|
|
public function setSkills(array|Collection $skills): self |
82
|
|
|
{ |
83
|
|
|
$this->skills = $skills; |
|
|
|
|
84
|
|
|
|
85
|
|
|
return $this; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @return Level[]|Collection |
90
|
|
|
*/ |
91
|
|
|
public function getLevels(): array|Collection |
92
|
|
|
{ |
93
|
|
|
return $this->levels; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @param Collection $levels |
98
|
|
|
*/ |
99
|
|
|
public function setLevels($levels): self |
100
|
|
|
{ |
101
|
|
|
$this->levels = $levels; |
102
|
|
|
|
103
|
|
|
return $this; |
104
|
|
|
} |
105
|
|
|
} |
106
|
|
|
|
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..