Answer the question
In order to leave comments, you need to log in
How to cache native SQL?
https://www.doctrine-project.org/projects/doctrine...
I only see DQL caching here.
How to cache this?
$select = '
SELECT * FROM users ' . $alias . '
ORDER BY ' . $alias. '.created_at ASC
';
$rsm = new ResultSetMappingBuilder($this->entityManager);
$rsm->addRootEntityFromClassMetadata(User::class, $this->usersAlias);
$query = $this->entityManager->createNativeQuery($select, $rsm);
return $query->getResult();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question