Skip to main content

Glossary O

Glossary · E-commerce

ORM

Area
E-commerce
Related
Shopware, API, Symfony

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.

One example in PHP is Doctrine ORM. The Doctrine documentation 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.

Sources

  1. Doctrine ORM Documentation (current): Architecture (opens in a new tab)

    Doctrine Project (doctrine-project.org) accessed

  2. Doctrine ORM Documentation (current): Getting Started with Doctrine (opens in a new tab)

    Doctrine Project (doctrine-project.org) accessed

  3. Doctrine DBAL Documentation (current, 4.6): Introduction (opens in a new tab)

    Doctrine Project (doctrine-project.org) accessed

  4. Shopware 5 Developer Guides: Plugin quick start guide (opens in a new tab)

    SafeFive (offiziell fortgeführte Shopware-5-Dokumentation) accessed

Share on LinkedIn

Let's talk about your project.

If this term is on your desk right now, a conversation usually helps faster than any definition.

Search the website

Popular topics

All results