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