I have a symfony application with several tables (or objects) that are associated with a place. Sometimes, throughout the app, I have to make some complex filtering (queries) to those objects based on the current place the user is navigating.
My idea, to avoid repeating a lot of code for several modules in the app, is to somehow override the execute() function from Doctrine_Query to apply the desired queries/filters when an extra parameter (the place value) was passed to it. I have no clue on how to achieve this, please help.
If you can achieve this easily using another approach, please share it as can't figure out any other way to do this.