News Feed
Jobs Feed
Sections




News Archive
Jani Hartikainen's Blog:
Creating a simple abstract model to reduce boilerplate code
March 02, 2009 @ 12:07:54

In a new blog post Jani Hartikainen shows how to create an abstract model that you can build on when you need to make a dynamic model for your framework application.

In a usual scenario involving models in PHP, you will have some repeating things: You will usually need getters and setters for the model's properties, you will need to be able to construct the model from an SQL query or such, and you'll also need to write SQL queries for the models.

He builds up the three different parts of the abstract model - the getters/setters, fleshing out the model by defining its properties from array values and creating some dynamic SQL (based on property names).

0 comments voice your opinion now!
biolerplate model dynamic framework getter setter properties sql


blog comments powered by Disqus

Similar Posts

Zend Developer Zone: PHP Security Tips #6 and #7

NetTuts.com: Build Ajax Data Grids with CodeIgniter and jQuery

Padraic Brady's Blog: PHP Framework Benchmarks: Entertaining But Ultimately Useless

Chris Hartjes' Blog: 10 Days Later - Early Impressions of CakePHP vs. CodeIgniter

Manfred Weber's Blog: PureMVC and Zend_AMF


Community Events











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


framework series object zendframework2 release functional code podcast introduction community example testing phpunit language interview development unittest conference tool opinion

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