This commit is contained in:
Dennis Eichhorn 2021-11-28 20:01:33 +01:00
parent 6cd43859ec
commit faf8423dd7

View File

@ -1233,7 +1233,7 @@ class DataMapperAbstract implements DataMapperInterface
$relProperty->setValue($value, $objId); $relProperty->setValue($value, $objId);
$relProperty->setAccessible(false); $relProperty->setAccessible(false);
} else { } 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 ??= self::getQuery(depth: $depth);
$query->where(static::$table . '_d' . $depth . '.' . ($column !== null ? self::getColumnByMember($column) : static::$primaryField), '>', $pivot); $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); return self::getAllByQuery($query, $relations, $depth);
} }
@ -2655,8 +2659,11 @@ class DataMapperAbstract implements DataMapperInterface
) : array ) : array
{ {
$query ??= self::getQuery(depth: $depth); $query ??= self::getQuery(depth: $depth);
$query->where(static::$table . '_d' . $depth . '.' . ($column !== null ? self::getColumnByMember($column) : static::$primaryField), '<', $pivot) $query->where(static::$table . '_d' . $depth . '.' . ($column !== null ? self::getColumnByMember($column) : static::$primaryField), '<', $pivot);
->limit($limit);
if ($limit > 0) {
$query->limit($limit);
}
return self::getAllByQuery($query, $relations, $depth); return self::getAllByQuery($query, $relations, $depth);
} }