In an application that is using Zend Framework 1.10 and Doctrine 1.2, where should the DQL statements live if our application is built such that it has a Service Layer and a Gateway(aka Doctrine_Table) layer.
It seems that our possibilities include:
1) Placing the DQL statements in the Service layer which seems to be a bit too high in our application hierarchy to store DQL.
2) Placing the DQL statements within each model's Table/Gateway which seems a bit redundant because we also need to expose the DQL statements that do things such as getAllUsers() through the Service layer.
Which of these is a preferable design? We intend to make use of the Service layer as much as possible so that other projects might consume various parts of our application.