Commit 52864db8 authored by Bernhard Schussek's avatar Bernhard Schussek

Added possibility to set the hydration mode during pagination

parent b6faeaa0
......@@ -579,8 +579,13 @@ abstract class ORMRepository extends EntityRepository implements EditableReposit
{
}
protected function fetchPage(QueryBuilder $qb, string $alias, PageRequest $pageRequest = null, Order $order = null): Page
{
protected function fetchPage(
QueryBuilder $qb,
string $alias,
PageRequest $pageRequest = null,
Order $order = null,
$hydrationMode = Query::HYDRATE_OBJECT
): Page {
$countQb = clone $qb;
$totalCount = $countQb->select(sprintf('COUNT(%s)', $alias))
......@@ -595,7 +600,7 @@ abstract class ORMRepository extends EntityRepository implements EditableReposit
$this->addPaginationCriteria($qb, $alias, $pageRequest, $order);
}
$results = $qb->getQuery()->execute();
$results = $qb->getQuery()->execute(null, $hydrationMode);
if ($pageRequest instanceof BeforeOffset) {
// BeforeOffset is implemented as reverse AfterOffset search
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment