O'Reilly logo

Persistence in PHP with Doctrine ORM by Kévin Dunglas

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. 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 ...

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