1 | <?php |
||
25 | trait RelationTrait |
||
26 | { |
||
27 | /** |
||
28 | * Role has many users (One-many relationship of User::role). |
||
29 | * |
||
30 | * @return Relations\HasMany |
||
31 | */ |
||
32 | 3 | public function users() |
|
33 | { |
||
34 | return $this |
||
35 | 3 | ->hasMany('Tinyissue\Model\User', 'role_id', 'id') |
|
36 | 3 | ->where('deleted', '=', User::NOT_DELETED_USERS) |
|
37 | 3 | ->orderBy('firstname', 'asc'); |
|
38 | } |
||
39 | |||
40 | /** |
||
41 | * Role has many users in a project_users. |
||
42 | * |
||
43 | * @return Relations\HasMany |
||
44 | */ |
||
45 | public function projectUsers() |
||
49 | |||
50 | /** |
||
51 | * Role has many role permission. |
||
52 | * |
||
53 | * @return Relations\BelongsToMany |
||
54 | */ |
||
55 | public function permissions() |
||
65 | } |
||
66 |