diff --git a/src/Dao/AbstractDao.php b/src/Dao/AbstractDao.php index 85d559a8..41f41099 100644 --- a/src/Dao/AbstractDao.php +++ b/src/Dao/AbstractDao.php @@ -81,7 +81,7 @@ abstract class AbstractDao implements ICrudDao if ($searchFilter->getPageSize() > 0) { $query->limit($searchFilter->getPageSize()); - $query->offset($searchFilter->getPageSize() * ($searchFilter->getPageNumber() - 1)); + $query->offset($searchFilter->getPageSize() * max(0, $searchFilter->getPageNumber() - 1)); } $entities = $this->arrayToEntities(iterator_to_array($query));