1 | <?php |
||
8 | trait UpdatesModelRelations |
||
9 | { |
||
10 | /** |
||
11 | * The model relationships that can be updated. |
||
12 | * |
||
13 | * @var array |
||
14 | */ |
||
15 | protected $fillableRelations = []; |
||
16 | |||
17 | /** |
||
18 | * Determine whether the given named relation can be updated on the model. |
||
19 | * |
||
20 | * @param string $relation |
||
21 | */ |
||
22 | protected function isFillableRelation(string $relation): bool |
||
26 | |||
27 | /** |
||
28 | * Determine the JSON API relation type for a named relation on the primary |
||
29 | * resource. |
||
30 | * |
||
31 | * @param string $relation |
||
32 | * |
||
33 | * @return string|void |
||
34 | */ |
||
35 | protected function getRelationType(string $relation) |
||
45 | |||
46 | /** |
||
47 | * Update a named many-to-one relationship association on a model instance. |
||
48 | * |
||
49 | * http://jsonapi.org/format/#crud-updating-to-one-relationships |
||
50 | * |
||
51 | * @param Model $record |
||
52 | * @param string $relation |
||
53 | * @param array $data |
||
54 | */ |
||
55 | protected function updateToOneResourceRelationship($record, string $relation, array $data) |
||
60 | |||
61 | /** |
||
62 | * Update named many-to-many relationship entries on a model instance. |
||
63 | * |
||
64 | * http://jsonapi.org/format/#crud-updating-to-many-relationships |
||
65 | * |
||
66 | * @param Model $record |
||
67 | * @param string $relation |
||
68 | * @param array $data |
||
69 | * @param string $method |
||
70 | */ |
||
71 | protected function updateToManyResourceRelationship($record, string $relation, array $data, string $method) |
||
94 | |||
95 | /** |
||
96 | * Update one or more relationships on a model instance from an array of |
||
97 | * named relationships and associated resource identifiers. |
||
98 | * |
||
99 | * http://jsonapi.org/format/#crud-updating-resource-relationships |
||
100 | * |
||
101 | * @param Model $record |
||
102 | * @param array $relationships |
||
103 | */ |
||
104 | protected function updateResourceRelationships($record, array $relationships) |
||
117 | } |
||
118 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.