<pedrocorreia.net ⁄>
 

<Learning PHP 5.3 by writing your own ORM ⁄ >




clicks: 134 134 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" ⁄>

Free spell checkers for HTML Forms

In this post I want to suggest you five interesting and free spell checkers for (...)

clicks: 244 244 2009-02-23 2009-02-23 goto url (new window) woork.blogspot.... goto myNews programacao


HTML5 for Beginners. Use it now, its easy!

Ok, so there are a lot of articles out there on HTML5, especially since Google W (...)

clicks: 50 50 2010-02-25 2010-02-25 goto url (new window) whatcreative.co... goto myNews programacao


Caching Best Practices

Shortly after my ASP.NET 3.5 book (1) was released in March 2008, I received fee (...)

clicks: 487 487 2008-08-07 2008-08-07 goto url (new window) imar.spaanjaars... goto myNews programacao


jQuery SimpleModal Plugin Version 1.2 with NicEdit WYSIWYG Editor

With the release of Eric Martin's version 1.2 of the SimpleModal jQuery Plugin, (...)

clicks: 611 611 2008-12-09 2008-12-09 goto url (new window) beckelman.net/p... goto myNews programacao


Do you always need index on WHERE column ?

I believe we wrote about this before, but this topic popups again and again. To (...)

clicks: 418 418 2008-04-29 2008-04-29 goto url (new window) mysqlperformanc... goto myNews programacao


What is Vertical Align?

CSS has a property called vertical align. It can be a bit confusing when you fir (...)

clicks: 257 257 2009-04-21 2009-04-21 goto url (new window) css-tricks.com/... goto myNews programacao


Vertical and Horizontal CSS Bar Graph

Currently, you may be running a website for long time which is also more popular (...)

clicks: 453 453 2008-11-11 2008-11-11 goto url (new window) tech.wowkhmer.c... goto myNews programacao


JIT methods at runtime

JIT stands for Just-in-Time compilation. You can read more about JIT here. Howev (...)

clicks: 306 306 2009-03-17 2009-03-17 goto url (new window) codeproject.com... goto myNews programacao