This commit is contained in:
Jake Barnby 2025-08-27 16:21:29 +12:00
parent 55a2f2d1fa
commit f4c56ad757
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -101,8 +101,7 @@ class V20 extends Filter
?string $collectionId = null,
?string $prefix = null,
int $depth = 1,
): array
{
): array {
$databaseId ??= $this->getParamValue('databaseId');
$collectionId ??= $this->getParamValue('collectionId');
@ -142,13 +141,13 @@ class V20 extends Filter
$key = $attr['key'];
$fullKey = $prefix ? $prefix . '.' . $key : $key;
// Add the wildcard select for this relationship
$relationshipKeys[] = $fullKey . '.*';
// Get the related collection for nested relationships
$relatedCollectionId = $attr['relatedCollection'] ?? null;
if ($relatedCollectionId) {
// Recursively get nested relationship keys
$nestedKeys = $this->getRelatedCollectionKeys(
@ -157,7 +156,7 @@ class V20 extends Filter
$fullKey,
$depth + 1,
);
$relationshipKeys = \array_merge($relationshipKeys, $nestedKeys);
}
}