protected function createResult(QueryBuilder
$builder) { /** @var Query<array<string, mixed>> $query */
$query =
$builder->
getQuery();
$query->
setHydrationMode(AbstractQuery::HYDRATE_ARRAY
);
$paginator =
$this->entityManager->
createPaginator($query);
$result =
iterator_to_array($paginator);
$field =
$this->
getIdentifierField();
$field =
explode('.',
$field);
return new SearcherResult( array_column($result,
$field[1
]),
$paginator->
count() );
} /**
* @return string
*/
protected function getIdentifierField() { return 'entity.id';
}