Introduction to the Doctrine ORM and data mapper pattern in php

The data mapper pattern is an architectural pattern by means of which it’s possible to achieve separation between a data persistence layer (in this case a mysql database) and an in-memory data representation (in this case php objects), so that the two layers can be separated and completely unaware of each other, thus respecting separation of concerns. In this tutorial we will see how to take our first steps with Doctrine, a data mapper pattern implementation that is part of the Symfony php framework, but can also be used on its own.