Passed
Push — master ( 251179...3b9d17 )
by Julito
09:58
created

Profile::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
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
13
/**
14
 * Profile.
15
 *
16
 * @ORM\Table(name="skill_level_profile")
17
 * @ORM\Entity
18
 */
19
class Profile
20
{
21
    /**
22
     * @ORM\Column(name="id", type="integer")
23
     * @ORM\Id
24
     * @ORM\GeneratedValue
25
     */
26
    protected int $id;
27
28
    /**
29
     * @ORM\Column(name="name", type="string", length=255, nullable=false)
30
     */
31
    protected string $name;
32
33
    /**
34
     * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Skill", mappedBy="profile", cascade={"persist"})
35
     *
36
     * @var Skill[]|Collection
37
     */
38
    protected Collection $skills;
39
40
    /**
41
     * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Level", mappedBy="profile", cascade={"persist"})
42
     * @ORM\OrderBy({"position"="ASC"})
43
     *
44
     * @var Level[]|Collection
45
     */
46
    protected Collection $levels;
47
48
    public function __construct()
49
    {
50
        $this->skills = new ArrayCollection();
51
        $this->levels = new ArrayCollection();
52
    }
53
54
    /**
55
     * @return string
56
     */
57
    public function __toString()
58
    {
59
        return (string) $this->getName();
60
    }
61
62
    /**
63
     * @return int
64
     */
65
    public function getId()
66
    {
67
        return $this->id;
68
    }
69
70
    /**
71
     * @return string
72
     */
73
    public function getName()
74
    {
75
        return $this->name;
76
    }
77
78
    /**
79
     * @return Profile
80
     */
81
    public function setName(string $name)
82
    {
83
        $this->name = $name;
84
85
        return $this;
86
    }
87
88
    public function getSkills()
89
    {
90
        return $this->skills;
91
    }
92
93
    /**
94
     * @return Profile
95
     */
96
    public function setSkills($skills)
97
    {
98
        $this->skills = $skills;
99
100
        return $this;
101
    }
102
103
    public function getLevels()
104
    {
105
        return $this->levels;
106
    }
107
108
    /**
109
     * @return Profile
110
     */
111
    public function setLevels($levels)
112
    {
113
        $this->levels = $levels;
114
115
        return $this;
116
    }
117
}
118