Answer the question
In order to leave comments, you need to log in
Doctrine 2 and Twig how to access object?
There are two entities Store and Price, you need to select the desired stores and prices for one query to the database.
The request looks very roughly like this.
$query = $this->getEntityManager()
->createQuery('SELECT Store, Price FROM AppStoreBundle:Store Store
JOIN Store.prices Price
WHERE Price.price > :price
ORDER BY Price.price ASC');
$query->setParameter('price', 200);
$stores = $query->getResult();
$stores[0]->getPrices()->getSnapshot()[0]->getPrice();
Answer the question
In order to leave comments, you need to log in
If you have such specific things, such as reports, etc. it makes sense to wrap the result in a DTO with a simple interface and pass it to the template.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question