PHP / Zend Framework: Which object would handle a complex table join?

Posted by Thomas on Stack Overflow See other posts from Stack Overflow or by Thomas
Published on 2010-03-28T21:55:40Z Indexed on 2010/03/28 22:03 UTC
Read the original article Hit count: 239

Filed under:
|
|
|

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()...

Zend DB Select with multiple table joins
Joining Tables With Zend Framework PHP
Joining tables wthin a model in Zend Php
Zend Framework Db Select Join table help
Zend DB Select with multiple table joins

My question is: Which object is best suited to handle this kind of multi-table select statement? 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...

Thanks!

© Stack Overflow or respective owner

Related posts about php

Related posts about zend-framework