- Added partial support for Index as primary keys

This commit is contained in:
Dave Mc Nicoll committed 2025-03-11 19:36:00 +00:00
1 parent e0ec140661
commit bfddf84564
4 files changed
+24 -9

No files matched your search

+1 -1
View File
@@ -97,7 +97,7 @@ class Repository implements RepositoryInterface
else {
$pk = Ulmus::resolveEntity($this->entityClass)->getPrimaryKeyField();
if (count($pk) === 1) {
if ($pk && count($pk) === 1) {
$field = key($pk);
$this->select(Common\Sql::function('COUNT', Common\Sql::raw("DISTINCT " . $this->entityClass::field($field))));