Over a million developers have joined DZone.

Doctrine: The Object Relational Mapper for PHP

· Database Zone

Build fast, scale big with MongoDB Atlas, a hosted service for the leading NoSQL database. Try it now! Brought to you in partnership with MongoDB.

I have read a lot about domain/model driven design, OOP best practices, etc. I have been using PHP for almost 10 years and I have always desired a way to build a relational database and represent it with a set of PHP classes using associations, inheritance, and collections.

Many other languages like ruby, java and python have fully featured ORM(object relational mapper) solutions which are great. PHP has many projects which call themselves ORM's but they are more of a glorified database abstraction layer. Almost one year ago I come across a very young project called Doctrine.

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.

Now it's easier than ever to get started with MongoDB, the database that allows startups and enterprises alike to rapidly build planet-scale apps. Introducing MongoDB Atlas, the official hosted service for the database on AWS. Try it now! Brought to you in partnership with MongoDB.


The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}