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