Completed
Push — master ( 0dfc19...c58ed8 )
by Julito
10:02
created

SkillRelItemRelUser   A

Complexity

Total Complexity 14

Size/Duplication

Total Lines 189
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 30
dl 0
loc 189
rs 10
c 0
b 0
f 0
wmc 14

14 Methods

Rating   Name   Duplication   Size   Complexity  
A getResultId() 0 3 1
A setUpdatedBy() 0 5 1
A getUserItemResultUrl() 0 5 1
A getId() 0 3 1
A setSkillRelItem() 0 5 1
A getSkillRelItem() 0 3 1
A getUpdatedBy() 0 3 1
A setUser() 0 5 1
A getUser() 0 3 1
A setResultId() 0 5 1
A setCreatedBy() 0 5 1
A getCreatedBy() 0 3 1
A setId() 0 5 1
A __construct() 0 4 1
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
namespace Chamilo\CoreBundle\Entity;
6
7
use Doctrine\ORM\Mapping as ORM;
8
use Gedmo\Timestampable\Traits\TimestampableEntity;
9
10
/**
11
 * SkillRelItemRelUser.
12
 *
13
 * @ORM\Table(name="skill_rel_item_rel_user")
14
 * @ORM\Entity
15
 */
16
class SkillRelItemRelUser
17
{
18
    use TimestampableEntity;
19
20
    /**
21
     * @var int
22
     *
23
     * @ORM\Column(name="id", type="integer")
24
     * @ORM\Id
25
     * @ORM\GeneratedValue
26
     */
27
    protected $id;
28
29
    /**
30
     * @var SkillRelItem
31
     *
32
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\SkillRelItem", cascade={"persist"})
33
     * @ORM\JoinColumn(name="skill_rel_item_id", referencedColumnName="id", nullable=false)
34
     */
35
    protected $skillRelItem;
36
37
    /**
38
     * @var User
39
     *
40
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", cascade={"persist"})
41
     * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
42
     */
43
    protected $user;
44
45
    /**
46
     * @var int
47
     *
48
     * @ORM\Column(name="result_id", type="integer", nullable=true)
49
     */
50
    protected $resultId;
51
52
    /**
53
     * @var int
54
     *
55
     * @ORM\Column(name="created_by", type="integer", nullable=false)
56
     */
57
    protected $createdBy;
58
59
    /**
60
     * @var int
61
     *
62
     * @ORM\Column(name="updated_by", type="integer", nullable=false)
63
     */
64
    protected $updatedBy;
65
66
    /**
67
     * SkillRelItemRelUser constructor.
68
     */
69
    public function __construct()
70
    {
71
        $this->createdAt = new \DateTime('now');
0 ignored issues
show
Bug Best Practice introduced by
The property createdAt does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
72
        $this->updatedAt = new \DateTime('now');
0 ignored issues
show
Bug Best Practice introduced by
The property updatedAt does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
73
    }
74
75
    /**
76
     * @return int
77
     */
78
    public function getId()
79
    {
80
        return $this->id;
81
    }
82
83
    /**
84
     * @param int $id
85
     *
86
     * @return SkillRelItemRelUser
87
     */
88
    public function setId($id)
89
    {
90
        $this->id = $id;
91
92
        return $this;
93
    }
94
95
    /**
96
     * @return SkillRelItem
97
     */
98
    public function getSkillRelItem()
99
    {
100
        return $this->skillRelItem;
101
    }
102
103
    /**
104
     * @param SkillRelItem $skillRelItem
105
     *
106
     * @return SkillRelItemRelUser
107
     */
108
    public function setSkillRelItem($skillRelItem)
109
    {
110
        $this->skillRelItem = $skillRelItem;
111
112
        return $this;
113
    }
114
115
    /**
116
     * @return User
117
     */
118
    public function getUser()
119
    {
120
        return $this->user;
121
    }
122
123
    /**
124
     * @param User $user
125
     *
126
     * @return SkillRelItemRelUser
127
     */
128
    public function setUser($user)
129
    {
130
        $this->user = $user;
131
132
        return $this;
133
    }
134
135
    /**
136
     * @return int
137
     */
138
    public function getCreatedBy()
139
    {
140
        return $this->createdBy;
141
    }
142
143
    /**
144
     * @param int $createdBy
145
     *
146
     * @return SkillRelItemRelUser
147
     */
148
    public function setCreatedBy($createdBy)
149
    {
150
        $this->createdBy = $createdBy;
151
152
        return $this;
153
    }
154
155
    /**
156
     * @return int
157
     */
158
    public function getUpdatedBy()
159
    {
160
        return $this->updatedBy;
161
    }
162
163
    /**
164
     * @param int $updatedBy
165
     *
166
     * @return SkillRelItemRelUser
167
     */
168
    public function setUpdatedBy($updatedBy)
169
    {
170
        $this->updatedBy = $updatedBy;
171
172
        return $this;
173
    }
174
175
    /**
176
     * @return int
177
     */
178
    public function getResultId()
179
    {
180
        return $this->resultId;
181
    }
182
183
    /**
184
     * @param int $resultId
185
     *
186
     * @return SkillRelItemRelUser
187
     */
188
    public function setResultId($resultId)
189
    {
190
        $this->resultId = $resultId;
191
192
        return $this;
193
    }
194
195
    /**
196
     * @param string $cidReq
197
     *
198
     * @return string
199
     */
200
    public function getUserItemResultUrl($cidReq)
201
    {
202
        $resultId = $this->getResultId();
203
204
        return $this->getSkillRelItem()->getItemResultUrl($cidReq).'&id='.$resultId;
205
    }
206
}
207