Views: 1186 (Data available since 06.02.2017)
Last Modified: 20.09.2017

ORM (Object-relational mapping) is a programming technique that connects databases with the concepts of object-oriented programming languages creating a "virtual object database" (Wikipedia).

Introduction

In the old core, its own GetList, Update, Add, and Delete are programmed for each entity.

Deficiencies of such method:

  • Different set of parameters;
  • Different syntax of the filter fields;
  • Events may be existent or non-existent;
  • Sometimes different code for different database (Add).
Purposes in the New Core:

To make database selecting and saving operations uniform with the same parameters and filters. If possible, entity tables must be serviced with a minimum of a new code. Standard events of adding/changing/deleting must be available automatically.

The following notions were introduced to implement these purposes:

  1. Entities (Bitrix\Main\Entity\Base).
  2. Entity fields (Bitrix\Main\Entity\Field and its successors).
  3. Data manager (Bitrix\Main\Entity\DataManager).

An entity describes a table in the database, and also contains entity fields. The DataManager performs selection and entity change operations. In practice, the work is mostly done at the level of the DataManager.




Courses developed by «Bitrix», Inc.