Best way to filter a relationship from a twig template
in my Symfony2 project, I've two entities: Spot and Weather, with a
one-to-many relationship "weatherReports" between the two entities.
Some weather reports are outdated, so I would like do create an
"activeWeatherRecords" method to filter the Weather entities in a Spot
entity.
Unfortunately, I can't see how to do this. The idea is not to fetch
objects from the controller since the Spot objects are favorited, linked
to an User object and accessed directly from a twig template.
So here is the question: What's the best way to filter a relationship
directly from a twig template?
Any idea is welcomed.
Cheers.
Cyril
No comments:
Post a Comment