<pedrocorreia.net ⁄>
 

<Learning PHP 5.3 by writing your own ORM ⁄ >




clicks: 270 270 2010-01-12 2010-01-12 goto programacao myNews programacao  Bookmark This Bookmark This


Creating an ORM for PHP is not an everyday task but writing one is a good way to improve your PHP skills, especially if you use some of the additional features PHP 5.3 adds to the language. There are many excellent ORMs (Object Relational Mappings) already in existence and for a real-world project it would probably better to use one of these, but this tutorial uses the task of creating an ORM as a way to take a look at applications for some PHP 5.3 features.

Getting started

We will start out by creating a database schema which we want to access with the ORM. To keep things simple we use the MySQL sample database Sakila, which can be downloaded from their website. The Sakila database is designed to represent a DVD rental store and we will use the film and actor tables for this tutorial. More information about the Sakila database, including installation instructions, can be found on the related pages. For this exercise you will need to install both the schema and the data from the Sakila database.

The next thing we need is a way to access our database. Because we are going to concentrate on writing an ORM and not a complete database layer we will use something that might be already familiar to most people, Zend Framework. Zend Framework already ships with its own ORM, Zend_Db_Table, but we ignore that for now and simply make use of the Zend_Db adapters to access the database.



este é só um excerto do artigo, para aceder ao artigo completo, clique no link em baixo:
this is just a small excerpt from the article, to access the full article please click in the link below:

http://techportal.ibuildings.com/2010/01/11/learning-php-5-3-by-writin...




Subscribe News RSS  Subscribe News Updates by E-mail





myNews <myNews show="rand" cat="programacao" ⁄>

A Collection of Examples of 64-bit Errors in Real Programs

Our company OOO "Program Verification Systems" develops a special static analyzer Viva64 that detect (...)

clicks: 22 22 2010-09-03 2010-09-03 goto url (new window) gamedev.net/ref... goto myNews programacao


Don't Rely on Environment.ProcessorCount

One of the most hidden knowledge in multithreaded programming is the question "How many threads I sh (...)

clicks: 53 53 2010-09-02 2010-09-02 goto url (new window) blog.liranchen.... goto myNews programacao


A Guide to Writing Games with QML

My last post on QML had a lot of people asking for an example, as opposed to a general discourse. In (...)

clicks: 53 53 2010-08-31 2010-08-31 goto url (new window) labs.trolltech.... goto myNews programacao


Ajax Best Practices: Reduce and Aggregate similar XHR calls

My mobile contract is expiring soon, so I went online and checked the different mobile companies for (...)

clicks: 43 43 2010-08-31 2010-08-31 goto url (new window) blog.dynatrace.... goto myNews programacao


Why jQuery needs JavaScriptMVC

More than a year and a half ago, I begged the jQuery community to start taking seriously the challen (...)

clicks: 55 55 2010-08-30 2010-08-30 goto url (new window) jupiterjs.com/n... goto myNews programacao


The Ultimate Roundup of 55+ CSS3 Tutorials

CSS3 is something that will take web development into the next level, while modernizing the web and (...)

clicks: 50 50 2010-08-29 2010-08-29 goto url (new window) 1stwebdesigner.... goto myNews programacao


Beginning PHP: 6 Must-See Sites, Programs and Articles For New Developers

These days there's a wealth of information online for anyone wishing to learn a new programming lang (...)

clicks: 72 72 2010-08-29 2010-08-29 goto url (new window) divisionbyzero.... goto myNews programacao


Making a simple custom Android UI animation

Animations are a great way to spice up the UI of your app. Although using too many animations can fr (...)

clicks: 57 57 2010-08-28 2010-08-28 goto url (new window) wiseandroid.com... goto myNews programacao