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

UsergroupRelUser::setUser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
namespace Chamilo\CoreBundle\Entity;
6
7
use Chamilo\CoreBundle\Traits\UserTrait;
8
use Doctrine\ORM\Mapping as ORM;
9
10
/**
11
 * Class UsergroupRelUser.
12
 *
13
 * @ORM\Table(
14
 *     name="usergroup_rel_user",
15
 *     indexes={
16
 *          @ORM\Index(name="IDX_739515A9A76ED395", columns={"user_id"}),
17
 *          @ORM\Index(name="IDX_739515A9D2112630", columns={"usergroup_id"})
18
 *     }
19
 * )
20
 * @ORM\Entity
21
 */
22
class UsergroupRelUser
23
{
24
    use UserTrait;
25
26
    /**
27
     * @var int
28
     *
29
     * @ORM\Column(name="id", type="integer", nullable=false, unique=false)
30
     * @ORM\Id
31
     * @ORM\GeneratedValue
32
     */
33
    protected $id;
34
35
    /**
36
     * @var User
37
     *
38
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", inversedBy="classes", cascade={"persist"})
39
     * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
40
     */
41
    protected $user;
42
43
    /**
44
     * @var Usergroup
45
     *
46
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Usergroup", inversedBy="users", cascade={"persist"})
47
     * @ORM\JoinColumn(name="usergroup_id", referencedColumnName="id")
48
     */
49
    protected $usergroup;
50
51
    /**
52
     * @var int
53
     *
54
     * @ORM\Column(name="relation_type", type="integer", nullable=false)
55
     */
56
    protected $relationType;
57
58
    /**
59
     * Get id.
60
     *
61
     * @return int
62
     */
63
    public function getId()
64
    {
65
        return $this->id;
66
    }
67
68
    /**
69
     * Set usergroup.
70
     *
71
     * @return UsergroupRelUser
72
     */
73
    public function setUsergroup(Usergroup $usergroup)
74
    {
75
        $this->usergroup = $usergroup;
76
77
        return $this;
78
    }
79
80
    /**
81
     * Get usergroup.
82
     *
83
     * @return Usergroup
84
     */
85
    public function getUsergroup()
86
    {
87
        return $this->usergroup;
88
    }
89
90
    /**
91
     * Set relationType.
92
     *
93
     * @param int $relationType
94
     *
95
     * @return $this
96
     */
97
    public function setRelationType($relationType)
98
    {
99
        $this->relationType = $relationType;
100
101
        return $this;
102
    }
103
104
    /**
105
     * Get relationType.
106
     *
107
     * @return int
108
     */
109
    public function getRelationType()
110
    {
111
        return $this->relationType;
112
    }
113
}
114