1 | <?php namespace Anomaly\UsersModule\Role; |
||
15 | class RoleModel extends UsersRolesEntryModel implements RoleInterface |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * The cache minutes. |
||
20 | * |
||
21 | * @var int |
||
22 | */ |
||
23 | protected $ttl = 99999; |
||
24 | |||
25 | /** |
||
26 | * Eager loaded relations. |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | protected $with = [ |
||
31 | 'translations' |
||
32 | ]; |
||
33 | |||
34 | /** |
||
35 | * Get the role slug. |
||
36 | * |
||
37 | * @return string |
||
38 | */ |
||
39 | public function getSlug() |
||
43 | |||
44 | /** |
||
45 | * Get the role name. |
||
46 | * |
||
47 | * @return string |
||
48 | */ |
||
49 | public function getName() |
||
53 | |||
54 | /** |
||
55 | * Get the role's permissions. |
||
56 | * |
||
57 | * @return array |
||
58 | */ |
||
59 | public function getPermissions() |
||
63 | |||
64 | /** |
||
65 | * Return if a role as access to a the permission. |
||
66 | * |
||
67 | * @param string $permission |
||
68 | * @return mixed |
||
69 | */ |
||
70 | public function hasPermission($permission) |
||
86 | |||
87 | /** |
||
88 | * Get the related users. |
||
89 | * |
||
90 | * @return UserCollection |
||
91 | */ |
||
92 | public function getUsers() |
||
96 | |||
97 | /** |
||
98 | * Return the users relation. |
||
99 | * |
||
100 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
101 | */ |
||
102 | public function users() |
||
111 | } |
||
112 |