@@ 36-43 (lines=8) @@ | ||
33 | * @param array $requested |
|
34 | * @return array |
|
35 | */ |
|
36 | public function relations(array $requested = []): array |
|
37 | { |
|
38 | $requested = $this->normalizeRelations($requested); |
|
39 | $relations = $this->applyQueryConstraints($this->extractRelations($requested)); |
|
40 | $nestedRelations = $this->nestedRelations($requested, $relations, 'relations'); |
|
41 | ||
42 | return array_merge($relations, $nestedRelations); |
|
43 | } |
|
44 | ||
45 | /** |
|
46 | * Get a list of default relations including nested relations. |
|
@@ 51-58 (lines=8) @@ | ||
48 | * @param array $requested |
|
49 | * @return array |
|
50 | */ |
|
51 | public function defaultRelations(array $requested = []): array |
|
52 | { |
|
53 | $requested = $this->normalizeRelations($requested); |
|
54 | $relations = $this->applyQueryConstraints($this->normalizeRelations($this->load)); |
|
55 | $nestedRelations = $this->nestedRelations($relations, array_merge($relations, $requested), 'defaultRelations'); |
|
56 | ||
57 | return array_merge($relations, $nestedRelations); |
|
58 | } |
|
59 | ||
60 | /** |
|
61 | * Get a list of available relations from the transformer with a normalized structure. |