1 | <?php |
||
18 | class PermissionRepository extends BaseRepository implements PermissionRepositoryInterface |
||
19 | { |
||
20 | /** |
||
21 | * Permission instance. |
||
22 | * |
||
23 | * @var \Laraflock\Dashboard\Models\Permission |
||
24 | */ |
||
25 | protected $permission; |
||
26 | |||
27 | /** |
||
28 | * The constructor. |
||
29 | * |
||
30 | * @param \Laraflock\Dashboard\Models\Permission $permission |
||
31 | */ |
||
32 | 110 | public function __construct(Permission $permission) |
|
36 | |||
37 | /** |
||
38 | * {@inheritDoc} |
||
39 | */ |
||
40 | 4 | public function getAll() |
|
44 | |||
45 | /** |
||
46 | * {@inheritDoc} |
||
47 | */ |
||
48 | 14 | public function getById($id) |
|
52 | |||
53 | /** |
||
54 | * {@inheritDoc} |
||
55 | */ |
||
56 | 24 | public function create(array $data, $validate = true) |
|
75 | |||
76 | /** |
||
77 | * {@inheritDoc} |
||
78 | */ |
||
79 | 6 | public function update(array $data, $id, $validate = true) |
|
104 | |||
105 | /** |
||
106 | * {@inheritDoc} |
||
107 | */ |
||
108 | 4 | public function delete($id) |
|
118 | } |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: