Chapter 5. Going Further

In previous chapters we learned the basics of the Doctrine ORM. We are now able to create complex domain classes, generate underlying SQL tables, load data fixtures, and execute advanced queries. We know everything we need to know to develop the model layer of small web applications.

The library, however, provides more advanced features. In this chapter we will briefly cover various topics not addressed previously: inheritance, lifecycle callbacks, and native queries.

Implementing inheritance

Like all object-oriented programming languages, PHP is designed on top of the inheritance concept; however, relational databases are not. This is the common problem when mapping classes to tables.

The Doctrine ORM provides the following ...

Get Persistence in PHP with Doctrine ORM now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.