News Feed
Sections




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

Michelangelo van Dam's Blog:
Zend Framework data models
January 12, 2010 @ 12:05:05

Michelangelo van Dam has a recent post to his blog about a difficulty he was having with his Zend Framework application and setting up some data models.

I was struggling getting my data models (as described in the Zend Framework Quickstart) to work with relations. My first solution was to create a database view that merged that data using joins to collect this data in a format that I could use in my data models. This was going great until I looked at my database where it contained over 20 views (along with 20 data models, mappers and db table gateways) ! So I said to myself there had to be another way.

His other way came in the form of the Zend_Db_Table_Relationships component and, after a bit of work, it did just what he needed. He shares how you can set them up similarly by walking you through the creation of a sample application ("datamodels") and linking together a series of sample tables with a Db_Table class using relationships, a simple model to abstract data access and a model mapper class to redefine some of the based functions (like "findAll") to pull in data from other tables.

1 comment voice your opinion now!
zendframework data model relationship mapper


blog comments powered by Disqus

Similar Posts

Ed Finkler's Blog: The Zend Framework and Its Influence on Secure PHP Development

GoodPHPTutorials.com: SQL Injections in PHP with MySQL

Olek Janiszewski's Blog: Autotest-like PHPUnit runner for a Zend Framework application

Dave Marshall's Blog: Traits in PHP 5.4 - HelloWorld with Logging Trait

Padraic Brady's Blog: Zend_Service_Openid Is dead; But It's Reincarnation Is Coming


Community Events





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


introduction community laravel symfony language version threedevsandamaybe podcast opinion series framework voicesoftheelephpant interview release list composer configure conference unittest api

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