News Feed
Jobs Feed
Sections




News Archive
Ralph Schindler's Blog:
Composite Rowsets For Many-To-Many Relationships Via Zend_Db_Table
November 16, 2010 @ 11:08:24

Ralph Schindler has posted a handy tutorial (along with some helpful code) to his blog today about handling many-to-many composite rowset relationships with the Zend_Db component of the Zend Framework.

One of the hardest problems to solve when developing an ORM of any complexity is in deciding how to handle the retrieval of rows that satisfy a many-to-many relationship, also known as a M:N relationship. [...] To model M:N relationships, database developers must get creative. By employing the use of a "3rd party", and by utilizing foreign keys that model a 1:N relationship, database developers can model a M:N relationship.

He looks at the Zend_Db_Table_Row class of the framework and how it works with these junction tables and how it has an issue where it returns the junction table columns too. A fix was released (in 1.10.2) for the framework to work correctly. Unfortunately, this also left those using the method out in the cold. So, Ralph has created his own workaround called a composite rowset. He includes an example snippet to give you an idea of how it works, but you can download the code from his github repository for a closer look.

0 comments voice your opinion now!
composite rowset zendframework zenddbtable manytomany database


blog comments powered by Disqus

Similar Posts

Nick Halstead's Blog: Making a TAG Cloud out of Zend_Cache

DZone.com: The Best Unknown Databases for PHP Apps

Brian Swan's Blog: SQL Server Driver for PHP Connection Options: Connection Pooling

Rob Allen's Blog: Zend Framework on a shared host

Henry Hayes' Blog: Firebug Console.Log for PHP using Zend Framework


Community Events









Don't see your event here?
Let us know!


code object opinion podcast development community introduction interview composer unittest tool language database framework release zendframework2 example phpunit testing api

All content copyright, 2013 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework