News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Rob Allen's Blog:
One-to-Many Joins with Zend_Db_Table_Select
February 08, 2012 @ 09:28:20

Rob Allen has a tip for the Zend Framework users out there using the Zend_Db module to connect to their database resources - how to do a one to many join with the help of Zend_Db_Table_Select (easier than it sounds).

Let's say that you want to set up a one-to-many relationship between two tables: Artists and Albums because you've refactored my ZF1 tutorial. [...] Assuming you're using Zend_Db_Table, the easiest way is to turn off the integrity check and do a join in a mapper or table method.

He includes a few lines of source to illustrate, calling the "setIntegrityCheck" value to "false" to tell ZF not to worry about the additional join value over to the artists table. The result is a new column value with the artist's name instead of just the ID.

0 comments voice your opinion now!
onetomany database table join zendframework zenddb component


blog comments powered by Disqus

Similar Posts

PHPBuilder.com: Search Google Books with the Zend Framework's Zend_Gdata Component

Pádraic Brady's Blog: Complex Views with the Zend Framework - Part 6: Setting The Terminology

Padraic Brady's Blog: Zend Framework Blog Tutorial - Part 8: Create/Add Blog Entries (HTMLPurifier)

Zend Developer Zone: PHP Abstract Podcast Episode 13: Introduction to the Zend Framework

Zend Developer Zone: Improved Test Assets for Zend_Tool Generated Projects in ZF 1.11.4


Community Events





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


install update api release podcast tips series library framework community interview list zendserver laravel package introduction opinion symfony deployment language

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