From a4242144eebc101bc1e5ec150a80312e30d0112f Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Sun, 11 Jul 2021 19:59:05 +0200 Subject: Modify parameter list for getAll method --- core/namespace/ORM/Repository.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/namespace/ORM') diff --git a/core/namespace/ORM/Repository.php b/core/namespace/ORM/Repository.php index 929dae3..c0677a9 100644 --- a/core/namespace/ORM/Repository.php +++ b/core/namespace/ORM/Repository.php @@ -213,13 +213,13 @@ abstract class Repository { # Get paginated entity list #=========================================================================== public function getPaginated(string $order, int $limit, int $offset = 0): array { - return $this->getAll([], $order, "$offset,$limit"); + return $this->getAll([], $order, $limit, $offset); } #=========================================================================== # Get all entities #=========================================================================== - public function getAll(array $filter = [], string $order = null, string $limit = null): array { + public function getAll(array $filter = [], string $order = null, int $limit = null, int $offset = 0): array { $select = 'SELECT * FROM '.static::getTableName(); $wheres = []; $params = []; @@ -242,7 +242,7 @@ abstract class Repository { } if($limit) { - $limit = "LIMIT $limit"; + $limit = "LIMIT $offset,$limit"; } $query = "$select %s %s %s"; -- cgit v1.2.3