Views: 600
Last Modified: 30.03.2022

Iblock ORM API allows to inherit Option to inherit elements from ORM is available fromiblock module version 21.500.0. entity for specific iblock, as well as to supplement or re-define its behaviour. You can inherit classes for the entity itself and its object. It's sufficient to indicate Table iblock class for inheriting an entity:

class MyExtTable extends Bitrix\Iblock\Elements\Element{API_CODE}Table
{
}

Parent class name uses API CODE from iblock settings. Object class description is specified by ORM general rules All entity objects are descendants for class Bitrix\Main\ORM\Objectify\EntityObject, with each entity having its own class for objects. By default, such class is created automatically, in passing.

Learn more...
, including configuring the class Table:

class MyExtTable extends Bitrix\Iblock\Elements\Element{API_CODE}Table
{
    public static function getObjectClass()
    {
        return MyExt::class;
    }
}

class MyExt extends EO_MyExt
{
}





Courses developed by Bitrix24