Views: 554 (Data available since 06.02.2017)
Last Modified: 01.07.2014
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).
In the old core, its own GetList, Update, Add, and Delete are programmed for each entity.
Deficiencies of such method:
Purposes in the New Core:
- Different set of parameters;
- Different syntax of the filter fields;
- Events may be existent or non-existent;
- Sometimes different code for different database (
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:
- Entities (Bitrix\Main\Entity\Base).
- Entity fields (Bitrix\Main\Entity\Field and its successors).
- 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.