1 | <?php |
||
9 | class RelationStore |
||
10 | { |
||
11 | /** |
||
12 | * List of all relations |
||
13 | * |
||
14 | * @var array |
||
15 | */ |
||
16 | public $relations = []; |
||
17 | |||
18 | /** |
||
19 | * Retrieve all relations. |
||
20 | * |
||
21 | * @param Model $model |
||
22 | * |
||
23 | * @return array |
||
24 | */ |
||
25 | 1 | public function all(Model $model) |
|
29 | |||
30 | /** |
||
31 | * Retrieve key |
||
32 | * |
||
33 | * @param Model $model |
||
34 | * @param string $key |
||
35 | * |
||
36 | * @return string |
||
37 | */ |
||
38 | 9 | public function getKey(Model $model, $key) |
|
42 | |||
43 | /** |
||
44 | * Retrieve a relation. |
||
45 | * |
||
46 | * @param Model $model |
||
47 | * @param string $key |
||
48 | * @param mixed $default |
||
49 | * |
||
50 | * @return mixed |
||
51 | */ |
||
52 | 7 | public function get(Model $model, $key, $default = null) |
|
56 | |||
57 | /** |
||
58 | * Set a relation. |
||
59 | * |
||
60 | * @param Model $model |
||
61 | * @param string $key |
||
62 | * @param mixed $value |
||
63 | */ |
||
64 | 8 | public function set(Model $model, $key, $value) |
|
68 | |||
69 | /** |
||
70 | * Retrieve a relation. |
||
71 | * |
||
72 | * @param Model $model |
||
73 | * @param string $key |
||
74 | * @param mixed $default |
||
75 | * |
||
76 | * @return mixed |
||
77 | */ |
||
78 | 7 | public function has(Model $model, $key) |
|
82 | |||
83 | /** |
||
84 | * Remove a relation. |
||
85 | * |
||
86 | * @param Model $model |
||
87 | * @param string $key |
||
88 | */ |
||
89 | 1 | public function unset(Model $model, $key) |
|
93 | } |
||
94 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.