I need to write a simple query: SELECT propertyName from TABLE_NAME WHERE abc > 10
I believe I can't do this with a simple $repository->findBy() so believe that DQL (or the query builder) would do the job. Something like this:
$query = $this->createQueryBuilder('x')
->where('x.abc > :amt')
->setParameter('amt', 10)
->getQuery();
$query->getResult();
However, I hear that Doctrine "Criteria", which was available from Doctrine 2.3, is a better method.
(1) I see very little documentation and still DQL is promoted the most. Could someone give me a very simple code sample that is the same as my one above (but using Criteria)?
(2) What about caching? I know I can do this with DQL, but what about Criteria?
$query->useResultCache('cache_id');