# ORM

> An ORM (object-relational mapping) is a layer in a program that translates data from the database, such as a shop's orders or products, into objects in the program code and back.

Original page: https://t10.de/en/glossary/orm
Publisher: total10 GmbH, https://t10.de/en/glossary

One example in PHP is Doctrine ORM. The [Doctrine documentation](https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/getting-started.html) says the ORM aims to simplify the translation between database rows and the PHP object model. Another stated aim is a complete separation of business logic from the way data is stored in the database. Technically, Doctrine ORM builds on Doctrine DBAL, which can also be used on its own, without the ORM.

Shopware 5 uses Doctrine too, and keeps its Doctrine models in the `engine/Shopware/Models` directory. Merchants see nothing of this layer. Some extensions, however, listen for the events the ORM uses to announce changes. Whether such an extension learns that the shop's data has changed depends on this layer.

Our Symfony applications use Doctrine as well. When debugging, we pay attention to how data is written. Shopware 5 showed us why: anything written directly through the DBAL bypasses the ORM and triggers none of its events, so a plugin listening for those events misses the change.

## See also

- [Shopware](https://t10.de/en/glossary/shopware): Shopware is e-commerce software from shopware AG in Schöppingen, Germany; the vendor says its current product, Shopware 6, is a complete redevelopment of Shopware 5.
- [API](https://t10.de/en/glossary/api): An API (application programming interface) is a defined set of functions and rules that lets one piece of software use the features or data of another system or service.
- [Symfony](https://t10.de/en/glossary/symfony): Symfony is an open-source PHP framework, a ready-made foundation for web applications, released under the MIT licence and developed by its community to a fixed release schedule.

## Sources

1. [Doctrine ORM Documentation (current): Architecture](https://www.doctrine-project.org/projects/doctrine-orm/en/current/reference/architecture.html), Doctrine Project (doctrine-project.org), accessed 2026-11-16
2. [Doctrine ORM Documentation (current): Getting Started with Doctrine](https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/getting-started.html), Doctrine Project (doctrine-project.org), accessed 2026-11-16
3. [Doctrine DBAL Documentation (current, 4.6): Introduction](https://www.doctrine-project.org/projects/doctrine-dbal/en/current/reference/introduction.html), Doctrine Project (doctrine-project.org), accessed 2026-11-16
4. [Shopware 5 Developer Guides: Plugin quick start guide](https://devdocs.safefive.de/developers-guide/plugin-quick-start/), SafeFive (offiziell fortgeführte Shopware-5-Dokumentation), accessed 2026-11-16
