I agree with the others -- and I'm the one who designed and coded the table-relationships API in Zend Framework that you're using!
The findDependentRowset()
is useful if you already have a reference to the parent row, and you might need to fetch related rows. This function is not efficient in the least, compared to a query joining both tables. You shouldn't call findDependentRowset()
in a loop, ever, if performance is a priority at all. Instead, write an SQL query consisting of a JOIN of both tables.
It's unfortunate in retrospect that Zend's goal for their Framework was simplicity of design, rather than performance.
If I had continued working at Zend, I would have tried to improve the Table interface with a convenient way to perform joined queries against related Zend_Db_Table objects. The solution implemented after I left the project is to build a Select object and pass it to fetchAll()
, which is terribly ugly.
edit: In reply to your comment, I did my best to create a solution given a set of requirements. I feel fine about what I did. But Zend is an IDE tools company, so naturally their value is in convenience of coding, not runtime performance. "Rapid Application Development" can mean to develop rapid applications, or to develop applications rapidly. For a tools company, it means the latter.