private function fetchCustomers(Criteria
$criteria, QueryBuilder
$query) { if ($criteria->
getOffset() !== null
) { $query->
setFirstResult($criteria->
getOffset());
} if ($criteria->
getLimit() !== null
) { $query->
setMaxResults($criteria->
getLimit());
} foreach ($criteria->
getSortings() as $sorting) { $handler =
$this->handlerRegistry->
getSortingHandler($sorting);
$handler->
handle($sorting,
$query);
} $query->
addSelect('customer.id, customer.customernumber, customer.email'
);
return $query->
execute()->
fetchAll(PDO::FETCH_ASSOC
);
} private function fetchTotal(QueryBuilder
$query) { $query->
select('COUNT(DISTINCT customer.id)'
);