O'Reilly logo

Extending Symfony2 Web Application Framework by Sébastien Armand

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Doctrine

Doctrine is the Object-relational Mapper (ORM) that ships with Symfony. It lets you work with PHP classes and objects, and handles their storage and retrieval to and from a data store. It can work with a variety of data stores such as traditional relational databases or document databases. The examples in this chapter will be either for the ORM or for the MongoDB ODM (Object-document Mapper).

Creating your own data types

Not all databases are created equal! MongoDB can store a collection of values or documents within a document, which is impossible in most relational databases. PostgreSQL can deal with geographical values, but MySQL can't.

For this reason, Doctrine only ships with a subset of standard supported types that are ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required