1 | <?php |
||
21 | class ModuleUser implements \JsonSerializable |
||
22 | { |
||
23 | const STATUS_ACTIVE = 'active'; |
||
24 | const STATUS_SUCCESS = 'success'; |
||
25 | const STATUS_FAILED = 'failed'; |
||
26 | |||
27 | /** |
||
28 | * @ORM\Id |
||
29 | * @ORM\GeneratedValue |
||
30 | * @ORM\Column(type="integer") |
||
31 | */ |
||
32 | private $id; |
||
33 | |||
34 | |||
35 | /** |
||
36 | * @ORM\Column(type="string") |
||
37 | */ |
||
38 | private $status; |
||
39 | |||
40 | /** |
||
41 | * @ORM\OneToMany(targetEntity="AppBundle\Entity\PassModule", mappedBy="moduleUser", cascade={"remove"}) |
||
42 | */ |
||
43 | private $passModules; |
||
44 | |||
45 | /** |
||
46 | * @ORM\ManyToOne(targetEntity="AppBundle\Entity\User", inversedBy="modulesUser") |
||
47 | */ |
||
48 | private $user; |
||
49 | |||
50 | /** |
||
51 | * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Module", inversedBy="modulesUser") |
||
52 | */ |
||
53 | private $module; |
||
54 | |||
55 | /** |
||
56 | * @ORM\Column(type="float") |
||
57 | */ |
||
58 | private $rating; |
||
59 | |||
60 | 1 | public function jsonSerialize() |
|
68 | |||
69 | |||
70 | 27 | public function __construct() |
|
76 | |||
77 | /** |
||
78 | * @return mixed |
||
79 | */ |
||
80 | 1 | public function getPassModules() |
|
84 | |||
85 | /** |
||
86 | * @param PassModule $passModule |
||
87 | * @return $this |
||
88 | */ |
||
89 | public function addPassModule(PassModule $passModule) |
||
95 | |||
96 | /** |
||
97 | * @param PassModule $passModule |
||
98 | */ |
||
99 | public function removePassModule(PassModule $passModule) |
||
103 | |||
104 | /** |
||
105 | * @return mixed |
||
106 | */ |
||
107 | 1 | public function getId() |
|
111 | |||
112 | /** |
||
113 | * @return mixed |
||
114 | */ |
||
115 | 1 | public function getAttempts() |
|
119 | |||
120 | /** |
||
121 | * @return mixed |
||
122 | */ |
||
123 | public function getIsActive() |
||
127 | |||
128 | |||
129 | /** |
||
130 | * @return mixed |
||
131 | */ |
||
132 | public function getUser() |
||
136 | |||
137 | /** |
||
138 | * @param mixed $user |
||
139 | * @return $this |
||
140 | */ |
||
141 | 27 | public function setUser(User $user = null) |
|
147 | |||
148 | /** |
||
149 | * @return mixed |
||
150 | */ |
||
151 | 4 | public function getModule() |
|
155 | |||
156 | /** |
||
157 | * @param mixed $module |
||
158 | * @return $this |
||
159 | */ |
||
160 | 27 | public function setModule(Module $module = null) |
|
166 | |||
167 | /** |
||
168 | * @return mixed |
||
169 | */ |
||
170 | public function getRating() |
||
174 | |||
175 | /** |
||
176 | * @param $rating |
||
177 | * @return $this |
||
178 | */ |
||
179 | 27 | public function setRating($rating) |
|
184 | |||
185 | |||
186 | 2 | public function getCountPassModules() |
|
190 | |||
191 | 1 | public function getInactivePassModules() |
|
198 | |||
199 | /** |
||
200 | * @return mixed |
||
201 | */ |
||
202 | 1 | public function getStatus() |
|
206 | |||
207 | /** |
||
208 | * @param mixed $status |
||
209 | */ |
||
210 | 27 | public function setStatus($status) |
|
216 | |||
217 | 1 | public function getLastModule() |
|
221 | |||
222 | } |
||
223 |