PHP and your domain model with Doctrine ORM

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.