views:

546

answers:

1

Hi,
I'm working on a project that requires a fair bit of inserting/updating rows in MySQL tables using Zend_Form. I'm trying to simplify the insert/update procedure by extending Zend_Db, and it seems a lot of this has been done with Zend_Db_Table and Zend_Db_Table_Row.

However, I can't understand how to link them together in the most efficient way. For example, I have a DB table called companies. I then have a model called CompaniesTable that extends Zend_Db_Table and a model called CompanyTable that extends Zend_Db_Table_Row.

I want to be able to query the companies table for rows, insert/update/delete individual companies etc. I see a few sites referring to the DomainModel (http://en.wikipedia.org/wiki/Domain_model) but can't find a good explanation of how to do it in Zend Framework.

Does anyone know of a good tutorial?

Cheers,
Matt

+2  A: 

http://www.survivethedeepend.com/ is the site for a free online book about best practices using ZF, being written by Pádraic Brady, a long-time ZF contributor.

Especially read Chapter 3, The Model, and Chapter 9, Implementing the Domain Model.

Bill Karwin
Excellent - thank you for the links :-)
fistameeny
Actually, do you know of any sites that explain how to call the data access model (on the above site, called the "Mapper") from the domain object model? It seems he hasn't got around to writing that chapter yet, and it's not clear what the best practice is for accessing the data mapper from the main model
fistameeny