From faf8423dd71fbd5f5f9b5959b31bd924a4b66e84 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 28 Nov 2021 20:01:33 +0100 Subject: [PATCH] fix typo --- DataStorage/Database/DataMapperAbstract.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/DataStorage/Database/DataMapperAbstract.php b/DataStorage/Database/DataMapperAbstract.php index e79adf45a..36d1a705f 100644 --- a/DataStorage/Database/DataMapperAbstract.php +++ b/DataStorage/Database/DataMapperAbstract.php @@ -1233,7 +1233,7 @@ class DataMapperAbstract implements DataMapperInterface $relProperty->setValue($value, $objId); $relProperty->setAccessible(false); } else { - $value->{$mapper}::$columns[static::$hasMany[$propertyName]['self']]['internal'] = $objId; + $value->{$mapper::$columns[static::$hasMany[$propertyName]['self']]['internal']} = $objId; } } @@ -2624,6 +2624,10 @@ class DataMapperAbstract implements DataMapperInterface $query ??= self::getQuery(depth: $depth); $query->where(static::$table . '_d' . $depth . '.' . ($column !== null ? self::getColumnByMember($column) : static::$primaryField), '>', $pivot); + if ($limit > 0) { + $query->limit($limit); + } + return self::getAllByQuery($query, $relations, $depth); } @@ -2655,8 +2659,11 @@ class DataMapperAbstract implements DataMapperInterface ) : array { $query ??= self::getQuery(depth: $depth); - $query->where(static::$table . '_d' . $depth . '.' . ($column !== null ? self::getColumnByMember($column) : static::$primaryField), '<', $pivot) - ->limit($limit); + $query->where(static::$table . '_d' . $depth . '.' . ($column !== null ? self::getColumnByMember($column) : static::$primaryField), '<', $pivot); + + if ($limit > 0) { + $query->limit($limit); + } return self::getAllByQuery($query, $relations, $depth); }