protected function hydrateResult(Result $result)
{
$repo = $this->em->getRepository($this->className);
$instances = [];
foreach ($result->records() as $record) {
$instances[] = $repo->hydrate($record, true, 'end', $this->className, true, true);
}
return $instances;
}