Doctrine ORM

← Doctrine ORM

Ashterix

docs(articles): SEO titles, intros and a section preview image for From Magento to Symfony

en/articles/magento-to-symfony/data/doctrine.md +4 −0

1 + ---
2 + title: 'Doctrine ORM for Magento developers: entities instead of models'
3 + ---
4 +
1 5 # Doctrine ORM
2 6
3 7 The hardest part of the move, because the very model of working with data changes. A Magento model resembles Active Record: the object knows how to save itself, and `save()` runs SQL right away. Doctrine is a Data Mapper with a Unit of Work: an entity is a plain PHP object that knows nothing about the database, and the EntityManager tracks changes to all loaded entities and writes them together on `flush()`.