Documentation

DataManager

Description

DataManager - abstract base class to handle data objects.

Queries the namespace:

Class uploads language messages for the current script: Loc::loadMessages(__FILE__).

When new class is responsible for access to the database table, it must be descendant to the class Bitrix\Main\Entity\DataManager This class is an alias to the class Bitrix\Main\ORM\Data\DataManager and must re-define only two methods:

  • getTableName to get table name,
  • getMap to get array of table columns - objects Bitrix\Main\Entity\Field.

Methods

Class Description Available from version
add Adds a column to entity table.
checkFields Checks data fields prior to writing into database.
delete Deletes an entity table column by primary key.
getById Returns selection by entity primary key.
getByPrimary Returns selection by entity primary key and by optional parameters \Bitrix\Main\Entity\DataManager::getList.
getConnectionName Returns entity connection name.
getCount Executes COUNT request to entity and returns a result.
getEntity Returns entity object.
getList Executes a request and returns data according to the request parameters.
getMap Returns entity map description.
getRow Returns single row (or null) by parameters for \Bitrix\Main\Entity\DataManager::getList.
getRowById Returns single row (or null) by primary entity key.
getTableName Returns a name for an entity database table.
query Creates and returns query object for entity.
update Updates a column of object's table by primary key.
enableCrypto Sets flag for field encoding support.
cryptoEnabled Returns true when encoding is permitted for a field.

Events

Event Description
Events for adding
OnBeforeAdd parameters: fields
OnAdd parameters: fields
OnAfterAdd parameters: fields, primary
Events for updating
OnBeforeUpdate parameters: primary, fields
OnUpdate parameters: primary, fields
OnAfterUpdate parameters: primary, fields
Events for deleting
OnBeforeDelete parameters: primary
OnDelete parameters: primary
OnAfterDelete parameters: primary

Learn more about events in Bitrix24 Framework learning course.



© «Bitrix24», 2001-2024