@@ 48-55 (lines=8) @@ | ||
45 | * @param array $requested |
|
46 | * @return array |
|
47 | */ |
|
48 | public function relations(array $requested = []): array |
|
49 | { |
|
50 | $requested = $this->normalizeRelations($requested); |
|
51 | $relations = $this->applyQueryConstraints($this->extractRelations($requested)); |
|
52 | $nestedRelations = $this->nestedRelations($requested, $relations, 'relations'); |
|
53 | ||
54 | return array_merge($relations, $nestedRelations); |
|
55 | } |
|
56 | ||
57 | /** |
|
58 | * Get a list of default relations including nested relations. |
|
@@ 63-70 (lines=8) @@ | ||
60 | * @param array $requested |
|
61 | * @return array |
|
62 | */ |
|
63 | public function defaultRelations(array $requested = []): array |
|
64 | { |
|
65 | $requested = $this->normalizeRelations($requested); |
|
66 | $relations = $this->applyQueryConstraints($this->normalizeRelations($this->load)); |
|
67 | $nestedRelations = $this->nestedRelations($relations, array_merge($relations, $requested), 'defaultRelations'); |
|
68 | ||
69 | return array_merge($relations, $nestedRelations); |
|
70 | } |
|
71 | ||
72 | /** |
|
73 | * Get a list of available relations from the transformer with a normalized structure. |