Zend Developer Zone
Where the ElePHPants come to learn

Zend Developer Zone

PHP and your domain model with Doctrine ORM

Incredibly Old Content Warning!

The content you are viewing is more than three years old. It is here for archival purposes. Do not use any advice in this article.

::Jedi Hand Wave:: This is not the information you are looking for. Move along.

For the last 10 years of doing web development with PHP I have been searching for a proper way to build my domain model and represent it with a relational database and a set of PHP classes. This has not existed until recently I came across a young open source PHP project named Doctrine.

I quickly jumped on the wagon and it has been quite an experience so far. Doctrine is an ORM for PHP that sits on top of a powerful DBAL (database abstraction layer). One of its key features is the ability to optionally write database queries in an OO (object oriented) SQL-dialect called DQL inspired by Hibernates HQL. This provides developers with a powerful alternative to SQL that maintains a maximum of flexibility without requiring needless code duplication.