title: PHP / Zend Framework: Which object would handle a complex table join?
body: <p>I think one of the more difficult concepts to understand in the Zend Framework is how the Table Data Gateway pattern is supposed to handle multi-table joins. Most of the suggestions I've seen claim that you simply handle the joins using a $db->select()...</p>
  
  <p><a href="https://stackoverflow.com/questions/1884313/zend-db-select-with-multiple-table-joins">Zend DB Select with multiple table joins</a> <br/>
  <a href="https://stackoverflow.com/questions/1199383/joining-tables-with-zend-framework-php">Joining Tables With Zend Framework PHP</a> <br/>
  <a href="https://stackoverflow.com/questions/1299647/joining-tables-wthin-a-model-in-zend-php">Joining tables wthin a model in Zend Php</a><br/>
  <a href="https://stackoverflow.com/questions/1270125/zend-framework-db-select-join-table-help">Zend Framework Db Select Join table help</a><br/>
  <a href="https://stackoverflow.com/questions/1884313/zend-db-select-with-multiple-table-joins">Zend DB Select with multiple table joins</a><br/></p>
  
  <p><strong>My question is: Which object is best suited to handle this kind of multi-table select statement?</strong> I feel like putting it in the model would break the 1-1 Table Data Gateway pattern between the class and the db table. Yet putting it in the controller seems wrong because why would a controller handle a SQL statement? Anyway, I feel like ZF makes handling datasets from multiple tables more difficult than it needs to be. Any help you can provide is great...</p>
  
  <p>Thanks!</p>