Completed
Pull Request — 1.11.x (#1163)
by José
71:40 queued 25:11
created

Profile::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
/**
6
 * Profile Entity
7
 *
8
 * @package chamilo.skill
9
 */
10
11
namespace Chamilo\SkillBundle\Entity;
12
13
use Doctrine\ORM\Mapping as ORM;
14
15
/**
16
 * Profile
17
 *
18
 * @ORM\Table(
19
 *  name="skill_level_profile",
20
 * )
21
 * @ORM\Entity
22
 */
23
class Profile
24
{
25
    /**
26
     * @var integer
27
     *
28
     * @ORM\Column(name="id", type="integer")
29
     * @ORM\Id
30
     * @ORM\GeneratedValue
31
     */
32
    protected $id;
33
34
    /**
35
     * @var string
36
     *
37
     * @ORM\Column(name="name", type="string", length=255, nullable=false)
38
     */
39
    protected $name;
40
41
    /**
42
     * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Skill", mappedBy="profile", cascade={"persist"})
43
     **/
44
    protected $skills;
45
46
    /**
47
     * @ORM\OneToMany(targetEntity="Chamilo\SkillBundle\Entity\Level", mappedBy="profile", cascade={"persist"})
48
     * @ORM\OrderBy({"position" = "ASC"})
49
     **/
50
    protected $levels;
51
52
    public function __toString()
53
    {
54
        return (string) $this->getName();
55
    }
56
57
    /**
58
     * @return int
59
     */
60
    public function getId()
61
    {
62
        return $this->id;
63
    }
64
65
    /**
66
     * @param int $id
67
     * @return Profile
68
     */
69
    public function setId($id)
70
    {
71
        $this->id = $id;
72
73
        return $this;
74
    }
75
76
    /**
77
     * @return string
78
     */
79
    public function getName()
80
    {
81
        return $this->name;
82
    }
83
84
    /**
85
     * @param string $name
86
     * @return Profile
87
     */
88
    public function setName($name)
89
    {
90
        $this->name = $name;
91
92
        return $this;
93
    }
94
95
    /**
96
     * @return mixed
97
     */
98
    public function getSkills()
99
    {
100
        return $this->skills;
101
    }
102
103
    /**
104
     * @param mixed $skills
105
     * @return Profile
106
     */
107
    public function setSkills($skills)
108
    {
109
        $this->skills = $skills;
110
111
        return $this;
112
    }
113
114
    /**
115
     * @return mixed
116
     */
117
    public function getLevels()
118
    {
119
        return $this->levels;
120
    }
121
122
    /**
123
     * @param mixed $levels
124
     * @return Profile
125
     */
126
    public function setLevels($levels)
127
    {
128
        $this->levels = $levels;
129
130
        return $this;
131
    }
132
133
}
134