Completed
Push — master ( c9546d...95f607 )
by Julito
09:41
created

CLpCategoryUser::getUser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
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\User;
8
use Chamilo\CoreBundle\Traits\UserTrait;
9
use Doctrine\ORM\Mapping as ORM;
10
11
/**
12
 * CLpCategoryUser.
13
 *
14
 * @ORM\Table(name="c_lp_category_user")
15
 * @ORM\Entity
16
 */
17
class CLpCategoryUser
18
{
19
    use UserTrait;
20
21
    /**
22
     * @var int
23
     *
24
     * @ORM\Column(name="id", type="integer")
25
     * @ORM\Id
26
     * @ORM\GeneratedValue
27
     */
28
    protected $id;
29
30
    /**
31
     * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CLpCategory", inversedBy="users")
32
     * @ORM\JoinColumn(name="category_id", referencedColumnName="iid")
33
     */
34
    protected $category;
35
36
    /**
37
     * @var User
38
     *
39
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User")
40
     * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
41
     */
42
    protected $user;
43
44
    /**
45
     * @return string
46
     */
47
    public function __toString()
48
    {
49
        return (string) $this->getId();
50
    }
51
52
    /**
53
     * @return int
54
     */
55
    public function getId()
56
    {
57
        return $this->id;
58
    }
59
60
    /**
61
     * @param int $id
62
     *
63
     * @return CLpCategoryUser
64
     */
65
    public function setId($id)
66
    {
67
        $this->id = $id;
68
69
        return $this;
70
    }
71
72
    /**
73
     * @return CLpCategory
74
     */
75
    public function getCategory()
76
    {
77
        return $this->category;
78
    }
79
80
    /**
81
     * @param CLpCategory $category
82
     *
83
     * @return CLpCategoryUser
84
     */
85
    public function setCategory($category)
86
    {
87
        $this->category = $category;
88
89
        return $this;
90
    }
91
}
92