RVRNEXT-22 use Select::paginate in repositories
This commit is contained in:
parent
bf415a2a46
commit
9929e00a3f
@ -52,11 +52,11 @@ class EventRepository
|
|||||||
yield from Container::$persistentDataManager->selectMultipleFromDb($select, Event::class, $useRelations, $withRelations);
|
yield from Container::$persistentDataManager->selectMultipleFromDb($select, Event::class, $useRelations, $withRelations);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPagedByCommunity(Community $community, int $start, int $limit, bool $useRelations = false, array $withRelations = []): Generator
|
public function getPagedByCommunity(Community $community, int $page, int $itemsPerPage, bool $useRelations = false, array $withRelations = []): Generator
|
||||||
{
|
{
|
||||||
$select = $this->selectAllByCommunity($community);
|
$select = $this->selectAllByCommunity($community);
|
||||||
$select->orderBy('start', 'DESC');
|
$select->orderBy('start', 'DESC');
|
||||||
$select->limit($limit, $start);
|
$select->paginate($page, $itemsPerPage);
|
||||||
|
|
||||||
yield from Container::$persistentDataManager->selectMultipleFromDb($select, Event::class, $useRelations, $withRelations);
|
yield from Container::$persistentDataManager->selectMultipleFromDb($select, Event::class, $useRelations, $withRelations);
|
||||||
}
|
}
|
||||||
|
@ -66,20 +66,20 @@ class TransactionRepository
|
|||||||
return $select->count() > 0;
|
return $select->count() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPagedByCommunity(Community $community, int $start, int $limit, bool $useRelations = false, array $withRelations = []): Generator
|
public function getPagedByCommunity(Community $community, int $page, int $itemsPerPage, bool $useRelations = false, array $withRelations = []): Generator
|
||||||
{
|
{
|
||||||
$select = $this->selectAllByCommunity($community);
|
$select = $this->selectAllByCommunity($community);
|
||||||
$select->orderBy('time', 'DESC');
|
$select->orderBy('time', 'DESC');
|
||||||
$select->limit($limit, $start);
|
$select->paginate($page, $itemsPerPage);
|
||||||
|
|
||||||
yield from Container::$persistentDataManager->selectMultipleFromDb($select, Transaction::class, $useRelations, $withRelations);
|
yield from Container::$persistentDataManager->selectMultipleFromDb($select, Transaction::class, $useRelations, $withRelations);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPagedByEvent(Event $event, int $start, int $limit, bool $useRelations = false, array $withRelations = []): Generator
|
public function getPagedByEvent(Event $event, int $page, int $itemsPerPage, bool $useRelations = false, array $withRelations = []): Generator
|
||||||
{
|
{
|
||||||
$select = $this->selectAllByEvent($event);
|
$select = $this->selectAllByEvent($event);
|
||||||
$select->orderBy('time', 'DESC');
|
$select->orderBy('time', 'DESC');
|
||||||
$select->limit($limit, $start);
|
$select->paginate($page, $itemsPerPage);
|
||||||
|
|
||||||
yield from Container::$persistentDataManager->selectMultipleFromDb($select, Transaction::class, $useRelations, $withRelations);
|
yield from Container::$persistentDataManager->selectMultipleFromDb($select, Transaction::class, $useRelations, $withRelations);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user