1 | <?php namespace Modules\User\Entities\Usher; |
||
14 | class User extends UsherUser implements UserInterface |
||
15 | { |
||
16 | /** |
||
17 | * Traits |
||
18 | */ |
||
19 | use PresentableTrait; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $presenter = 'Modules\User\Presenters\UserPresenter'; |
||
25 | |||
26 | /** |
||
27 | * @ORM\ManyToMany(targetEntity="Role", inversedBy="users") |
||
28 | * @ORM\JoinTable(name="user_roles") |
||
29 | * @var ArrayCollection|\Maatwebsite\Usher\Contracts\Roles\Role[] |
||
30 | */ |
||
31 | protected $roles; |
||
32 | |||
33 | /** |
||
34 | * @return ArrayCollection|\Maatwebsite\Usher\Contracts\Roles\Role[] |
||
35 | */ |
||
36 | public function getRoles() |
||
40 | |||
41 | /** |
||
42 | * @param ArrayCollection|Role[] $roles |
||
43 | */ |
||
44 | public function setRoles(ArrayCollection $roles) |
||
48 | |||
49 | /** |
||
50 | * @return string |
||
51 | */ |
||
52 | public function getFirstName() |
||
56 | |||
57 | /** |
||
58 | * @return string |
||
59 | */ |
||
60 | public function getLastName() |
||
64 | |||
65 | /** |
||
66 | * @param $attribute |
||
67 | * @return null|string |
||
68 | */ |
||
69 | public function __get($attribute) |
||
79 | |||
80 | /** |
||
81 | * @param $attribute |
||
82 | * @return bool |
||
83 | */ |
||
84 | public function __isset($attribute) |
||
94 | |||
95 | /** |
||
96 | * Checks if a user belongs to the given Role ID |
||
97 | * @param int $roleId |
||
98 | * @return bool |
||
99 | */ |
||
100 | public function hasRoleId($roleId) |
||
103 | |||
104 | /** |
||
105 | * Checks if a user belongs to the given Role Name |
||
106 | * @param string $name |
||
107 | * @return bool |
||
108 | */ |
||
109 | public function hasRoleName($name) |
||
112 | |||
113 | /** |
||
114 | * Check if the current user is activated |
||
115 | * @return bool |
||
116 | */ |
||
117 | public function isActivated() |
||
120 | } |
||
121 |