Skip to content

Commit b871c55

Browse files
author
Marius
committed
fix relation decoration
1 parent c93df8b commit b871c55

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Decorators/AbstractResourceDecorator.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,11 @@ public static function applyHtmlSpecialChars(mixed $value): mixed
215215
public function isRelationAggregate(string $columnName): bool
216216
{
217217
return (
218-
\in_array(\substr($columnName, -6), [static::COUNT_SUFFIX, static::EXIST_SUFFIX], true)
219-
&& isset($this->getRelationMappings()[\substr($columnName, 0, -6)])
218+
\substr($columnName, -6) === static::COUNT_SUFFIX
219+
&& \in_array(\substr($columnName, 0, -6), $this->getCountRelations(), true)
220+
) || (
221+
\substr($columnName, -6) === static::EXIST_SUFFIX
222+
&& \in_array(\substr($columnName, 0, -6), $this->getExistRelations(), true)
220223
);
221224
}
222225
}

0 commit comments

Comments
 (0)