Bitrix API

Mesh extends Tree

AbstractYes

Base entity data manager

Table of Contents

Constants

EVENT_ON_ADD  = "OnAdd"
EVENT_ON_AFTER_ADD  = "OnAfterAdd"
EVENT_ON_AFTER_DELETE  = "OnAfterDelete"
EVENT_ON_AFTER_UPDATE  = "OnAfterUpdate"
EVENT_ON_BEFORE_ADD  = "OnBeforeAdd"
EVENT_ON_BEFORE_DELETE  = "OnBeforeDelete"
EVENT_ON_BEFORE_UPDATE  = "OnBeforeUpdate"
EVENT_ON_DELETE  = "OnDelete"
EVENT_ON_UPDATE  = "OnUpdate"

Methods

add()  : AddResult
Adds row to entity table
addMulti()  : AddResult
Adds several rows to entity table.
checkFields()  : mixed
Checks the data fields before saving to DB. Result stores in the $result object
checkItemLinked()  : mixed
Check if the item is linked with some other items
cleanCache()  : void
Cleans the tablet cache after data modifications.
createCollection()  : null
createLink()  : AddResult
Links one item with another. Low-level method.
createObject()  : null
cryptoEnabled()  : bool
Returns true if crypto is enabled for a field.
delete()  : DeleteResult
Deletes row in entity table by primary key
deleteLink()  : mixed
Breaks link between nodes. Low-level method.
deleteSubtree()  : mixed
dropLinkL()  : mixed
enableCrypto()  : mixed
Sets a flag indicating crypto support for a field.
getById()  : Result
Returns selection by entity's primary key
getByPrimary()  : Result
Returns selection by entity's primary key and optional parameters for getList()
getCollectionClass()  : string|Collection
Returns class of Object collection for current entity.
getCollectionClassName()  : string
Returns class name (without namespace) of Object collection for current entity.
getCollectionParentClass()  : Collection|string
getConnectionName()  : string
Returns connection name for entity
getCount()  : int
Performs COUNT query on entity and returns the result.
getDIRECTColumnName()  : mixed
getEntity()  : Entity
Returns entity object
getEntityClass()  : Entity|string
getIDColumnName()  : mixed
getLinkCount()  : mixed
getList()  : Result
Executes the query and returns selection by parameters of the query. This function is an alias to the Query object functions
getMap()  : array<string|int, mixed>
Returns entity map definition.
getMPCITYColumnName()  : mixed
getObjectClass()  : string|EntityObject
Returns class of Object for current entity.
getObjectClassName()  : string
Returns class name (without namespace) of Object for current entity.
getObjectParentClass()  : EntityObject|string
getParentId()  : mixed
getPARENTIDColumnName()  : mixed
getPathToNode()  : mixed
getPathToNodeSql()  : mixed
getQueryClass()  : Query|string
getRow()  : array<string|int, mixed>|null
Returns one row (or null) by parameters for getList()
getRowById()  : array<string|int, mixed>|null
Returns one row (or null) by entity's primary key
getSubTree()  : mixed
getSubTreeSql()  : mixed
getTableName()  : string
Returns DB table name for entity
getTitle()  : string|null
getUfId()  : mixed
isCacheable()  : bool
You can disable cache for the tablet completely.
isUtm()  : mixed
isUts()  : mixed
link()  : mixed
moveLink()  : mixed
Moves subtree. Low-level method.
onAdd()  : mixed
onAfterAdd()  : mixed
onAfterDelete()  : mixed
onAfterUpdate()  : mixed
onBeforeAdd()  : mixed
onBeforeDelete()  : mixed
onBeforeUpdate()  : mixed
onDelete()  : mixed
onUpdate()  : mixed
postInitialize()  : null
query()  : Query
Creates and returns the Query object for the entity
setCurrentDeletingObject()  : void
setDefaultScope()  : Query
unlink()  : mixed
unsetEntity()  : mixed
update()  : UpdateResult
Updates row in entity table by primary key
updateMulti()  : UpdateResult
wakeUpCollection()  : null
wakeUpObject()  : null

Constants

EVENT_ON_AFTER_ADD

public mixed EVENT_ON_AFTER_ADD = "OnAfterAdd"

EVENT_ON_AFTER_DELETE

public mixed EVENT_ON_AFTER_DELETE = "OnAfterDelete"

EVENT_ON_AFTER_UPDATE

public mixed EVENT_ON_AFTER_UPDATE = "OnAfterUpdate"

EVENT_ON_BEFORE_ADD

public mixed EVENT_ON_BEFORE_ADD = "OnBeforeAdd"

EVENT_ON_BEFORE_DELETE

public mixed EVENT_ON_BEFORE_DELETE = "OnBeforeDelete"

EVENT_ON_BEFORE_UPDATE

public mixed EVENT_ON_BEFORE_UPDATE = "OnBeforeUpdate"

EVENT_ON_DELETE

public mixed EVENT_ON_DELETE = "OnDelete"

EVENT_ON_UPDATE

public mixed EVENT_ON_UPDATE = "OnUpdate"

Methods

add()

Adds row to entity table

public static add(array<string|int, mixed> $data) : AddResult
Parameters
$data : array<string|int, mixed>

An array with fields like array( "fields" => array( "FIELD1" => "value1", "FIELD2" => "value2", ), "auth_context" => \Bitrix\Main\Authentication\Context object ) or just a plain array of fields.

This method uses the default strategy defined in the class.

Tags
throws
Exception
Return values
AddResult

Contains ID of inserted row

addMulti()

Adds several rows to entity table.

public static addMulti(mixed $rows[, bool $ignoreEvents = false ]) : AddResult

This method uses the default strategy defined in the class.

Parameters
$rows : mixed
$ignoreEvents : bool = false
Tags
throws
ArgumentException
throws
SystemException
Return values
AddResult

checkFields()

Checks the data fields before saving to DB. Result stores in the $result object

public static checkFields(Result $result, mixed $primary, array<string|int, mixed> $data) : mixed
Parameters
$result : Result
$primary : mixed
$data : array<string|int, mixed>
Tags
throws
ArgumentException
throws
SystemException

checkItemLinked()

Check if the item is linked with some other items

public static checkItemLinked(mixed $id) : mixed
Parameters
$id : mixed

cleanCache()

Cleans the tablet cache after data modifications.

public static cleanCache() : void

createCollection()

public final static createCollection() : null
Tags
throws
ArgumentException
throws
SystemException
Return values
null

Actual type should be annotated by orm:annotate

Links one item with another. Low-level method.

public static createLink(mixed $id, mixed $parentId[, mixed $behaviour = array('LINK_DATA' => array()) ]) : AddResult
Parameters
$id : mixed
$parentId : mixed
$behaviour : mixed = array('LINK_DATA' => array())
Return values
AddResult

createObject()

public final static createObject([bool $setDefaultValues = true ]) : null
Parameters
$setDefaultValues : bool = true
Tags
throws
ArgumentException
throws
SystemException
Return values
null

Actual type should be annotated by orm:annotate

cryptoEnabled()

Returns true if crypto is enabled for a field.

public static cryptoEnabled(string $field[, string $table = null ]) : bool
Parameters
$field : string
$table : string = null
Return values
bool

delete()

Deletes row in entity table by primary key

public static delete(mixed $primary) : DeleteResult
Parameters
$primary : mixed
Tags
throws
Exception
Return values
DeleteResult

Breaks link between nodes. Low-level method.

public static deleteLink(mixed $id[, mixed $parentId = false ][, array<string|int, mixed> $behaviour = array('CHILDREN' => 'unlink') ]) : mixed
Parameters
$id : mixed
$parentId : mixed = false
$behaviour : array<string|int, mixed> = array('CHILDREN' => 'unlink')

deleteSubtree()

public static deleteSubtree(mixed $id) : mixed
Parameters
$id : mixed

dropLinkL()

public static dropLinkL(mixed $id[, mixed $parentId = false ][, mixed $behaviour = array('CHILDREN' => 'unlink') ]) : mixed
Parameters
$id : mixed
$parentId : mixed = false
$behaviour : mixed = array('CHILDREN' => 'unlink')

enableCrypto()

Sets a flag indicating crypto support for a field.

public static enableCrypto(string $field[, string $table = null ][, bool $mode = true ]) : mixed
Parameters
$field : string
$table : string = null
$mode : bool = true

getById()

Returns selection by entity's primary key

public static getById(mixed $id) : Result
Parameters
$id : mixed

Primary key of the entity

Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
Result

getByPrimary()

Returns selection by entity's primary key and optional parameters for getList()

public static getByPrimary(mixed $primary[, array<string|int, mixed> $parameters = array() ]) : Result
Parameters
$primary : mixed

Primary key of the entity

$parameters : array<string|int, mixed> = array()

Additional parameters for getList()

Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
Result

getCollectionClass()

Returns class of Object collection for current entity.

public static getCollectionClass() : string|Collection
Return values
string|Collection

getCollectionClassName()

Returns class name (without namespace) of Object collection for current entity.

public final static getCollectionClassName() : string
Return values
string

getConnectionName()

Returns connection name for entity

public static getConnectionName() : string
Return values
string

getCount()

Performs COUNT query on entity and returns the result.

public static getCount([array<string|int, mixed>|ConditionTree $filter = array() ][, array<string|int, mixed> $cache = array() ]) : int
Parameters
$filter : array<string|int, mixed>|ConditionTree = array()
$cache : array<string|int, mixed> = array()

An array of cache options "ttl" => integer indicating cache TTL

Tags
throws
ObjectPropertyException
throws
SystemException
Return values
int

getDIRECTColumnName()

public static getDIRECTColumnName() : mixed

getEntity()

Returns entity object

public static getEntity() : Entity
Tags
throws
ArgumentException
throws
SystemException
Return values
Entity

getIDColumnName()

public static getIDColumnName() : mixed

getLinkCount()

public static getLinkCount() : mixed

getList()

Executes the query and returns selection by parameters of the query. This function is an alias to the Query object functions

public static getList([array<string|int, mixed> $parameters = array() ]) : Result
Parameters
$parameters : array<string|int, mixed> = array()

An array of query parameters, available keys are:
"select" => array of fields in the SELECT part of the query, aliases are possible in the form of "alias"=>"field";
"filter" => array of filters in the WHERE/HAVING part of the query in the form of "(condition)field"=>"value"; also could be an instance of Filter;
"group" => array of fields in the GROUP BY part of the query;
"order" => array of fields in the ORDER BY part of the query in the form of "field"=>"asc|desc";
"limit" => integer indicating maximum number of rows in the selection (like LIMIT n in MySql);
"offset" => integer indicating first row number in the selection (like LIMIT n, 100 in MySql);
"runtime" => array of entity fields created dynamically;
"cache => array of cache options:
"ttl" => integer indicating cache TTL;
"cache_joins" => boolean enabling to cache joins, false by default.

Tags
see
Query::filter()
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
Result

getMap()

Returns entity map definition.

public static getMap() : array<string|int, mixed>
Return values
array<string|int, mixed>

getMPCITYColumnName()

public static getMPCITYColumnName() : mixed

getObjectClassName()

Returns class name (without namespace) of Object for current entity.

public final static getObjectClassName() : string
Return values
string

getParentId()

public static getParentId(mixed $id) : mixed
Parameters
$id : mixed

getPARENTIDColumnName()

public static getPARENTIDColumnName() : mixed

getPathToNode()

public static getPathToNode(mixed $id[, mixed $parameters = array() ]) : mixed
Parameters
$id : mixed
$parameters : mixed = array()

getPathToNodeSql()

public static getPathToNodeSql(mixed $id) : mixed
Parameters
$id : mixed

getRow()

Returns one row (or null) by parameters for getList()

public static getRow(array<string|int, mixed> $parameters) : array<string|int, mixed>|null
Parameters
$parameters : array<string|int, mixed>

Primary key of the entity

Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
array<string|int, mixed>|null

getRowById()

Returns one row (or null) by entity's primary key

public static getRowById(mixed $id[, array<string|int, mixed> $parameters = [] ]) : array<string|int, mixed>|null
Parameters
$id : mixed

Primary key of the entity

$parameters : array<string|int, mixed> = []

Additional parameters for getList()

Tags
throws
ArgumentException
throws
ObjectPropertyException
throws
SystemException
Return values
array<string|int, mixed>|null

getSubTree()

public static getSubTree(mixed $id[, mixed $parameters = array() ][, array<string|int, mixed> $behaviour = array('INCLUDE_SELF' => true) ]) : mixed
Parameters
$id : mixed
$parameters : mixed = array()
$behaviour : array<string|int, mixed> = array('INCLUDE_SELF' => true)

getSubTreeSql()

public static getSubTreeSql(mixed $id) : mixed
Parameters
$id : mixed

getTableName()

Returns DB table name for entity

public static getTableName() : string
Return values
string

getTitle()

public static getTitle() : string|null
Return values
string|null

isCacheable()

You can disable cache for the tablet completely.

public static isCacheable() : bool
Return values
bool
public static link(mixed $id, mixed $parentId) : mixed
Parameters
$id : mixed
$parentId : mixed

Moves subtree. Low-level method.

public static moveLink(mixed $id, mixed $parentId[, mixed $behaviour = array('CREATE_PARENT_NODE_ON_NOTFOUND' => true) ]) : mixed
Parameters
$id : mixed
$parentId : mixed
$behaviour : mixed = array('CREATE_PARENT_NODE_ON_NOTFOUND' => true)

postInitialize()

public static postInitialize(Entity $entity) : null
Parameters
$entity : Entity
Return values
null

query()

Creates and returns the Query object for the entity

public static query() : Query
Tags
throws
ArgumentException
throws
SystemException
Return values
Query
public static unlink(mixed $id) : mixed
Parameters
$id : mixed

unsetEntity()

public static unsetEntity(mixed $class) : mixed
Parameters
$class : mixed

update()

Updates row in entity table by primary key

public static update(mixed $primary, array<string|int, mixed> $data) : UpdateResult
Parameters
$primary : mixed
$data : array<string|int, mixed>

An array with fields like array( "fields" => array( "FIELD1" => "value1", "FIELD2" => "value2", ), "auth_context" => \Bitrix\Main\Authentication\Context object ) or just a plain array of fields.

Tags
throws
Exception
Return values
UpdateResult

updateMulti()

public static updateMulti(array<string|int, mixed> $primaries, array<string|int, mixed> $data[, bool $ignoreEvents = false ]) : UpdateResult
Parameters
$primaries : array<string|int, mixed>
$data : array<string|int, mixed>
$ignoreEvents : bool = false
Tags
throws
ArgumentException
throws
SystemException
Return values
UpdateResult

wakeUpCollection()

public final static wakeUpCollection(mixed $rows) : null
Parameters
$rows : mixed
Tags
see
Collection::wakeUp()
throws
ArgumentException
throws
SystemException
Return values
null

Actual type should be annotated by orm:annotate

wakeUpObject()

public final static wakeUpObject(mixed $row) : null
Parameters
$row : mixed
Tags
see
EntityObject::wakeUp()
throws
ArgumentException
throws
SystemException
Return values
null

Actual type should be annotated by orm:annotate


        
On this page

Search results