TypeTable extends TypeDataManager
Class TypeTable
DO NOT WRITE ANYTHING BELOW THIS
<<< ORMENTITYANNOTATION
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"
- MAXIMUM_TABLE_NAME_LENGTH = 64
Methods
- add() : AddResult
- Adds row to entity table
- addMulti() : AddResult
- checkFields() : mixed
- Checks the data fields before saving to DB. Result stores in the $result object
- cleanCache() : void
- Cleans the tablet cache after data modifications.
- compileEntity() : Entity
- compileItemFieldsContextEntity() : Entity
- compileItemIndexEntity() : Entity
- createCollection() : EO_Type_Collection
- createItemFieldsContextTable() : Result
- createItemIndexTable() : Result
- createItemIndexTableInAgent() : string
- createObject() : Type
- cryptoEnabled() : bool
- Returns true if crypto is enabled for a field.
- delete() : DeleteResult
- Deletes row in entity table by primary key
- deleteEntityAutomation() : void
- deleteItemFieldsContextTable() : Result
- deleteItemIndexTable() : Result
- enableCrypto() : mixed
- Sets a flag indicating crypto support for a field.
- generateName() : string|null
- getByEntityTypeId() : Result
- getById() : EO_Type_Result
- Returns selection by entity's primary key
- getByPrimary() : EO_Type_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.
- getEntity() : EO_Type_Entity
- Returns entity object
- getEntityClass() : Entity|string
- getFactory() : TypeFactory
- getFieldsInfo() : array<string|int, mixed>
- getList() : EO_Type_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.
- getMultipleValueTableName() : string
- getNextAvailableEntityTypeId() : int|null
- getObjectClass() : Entity|string
- Returns class of Object for current entity.
- getObjectClassName() : string
- Returns class name (without namespace) of Object for current entity.
- getObjectParentClass() : EntityObject|string
- 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
- getTableName() : string
- Returns DB table name for entity
- getTitle() : string|null
- getUfId() : mixed
- getUtmEntityClassName() : string
- isCacheable() : bool
- You can disable cache for the tablet completely.
- isCreatingInProgress() : bool
- isUtm() : mixed
- isUts() : mixed
- onAdd() : mixed
- onAfterAdd() : EventResult
- onAfterDelete() : EventResult
- onAfterUpdate() : EventResult
- onBeforeAdd() : EventResult
- onBeforeDelete() : EventResult
- onBeforeUpdate() : EventResult
- onDelete() : mixed
- onUpdate() : mixed
- postInitialize() : null
- query() : EO_Type_Query
- Creates and returns the Query object for the entity
- resolveType() : array<string|int, mixed>|null
- setCurrentDeletingObject() : void
- setDefaultScope() : Query
- unsetEntity() : mixed
- update() : UpdateResult
- Updates row in entity table by primary key
- updateMulti() : UpdateResult
- validateEntityTypeId() : mixed
- validateTableExisting() : mixed
- wakeUpCollection() : EO_Type_Collection
- wakeUpObject() : Type
Constants
EVENT_ON_ADD
public
mixed
EVENT_ON_ADD
= "OnAdd"
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"
MAXIMUM_TABLE_NAME_LENGTH
public
mixed
MAXIMUM_TABLE_NAME_LENGTH
= 64
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.
Tags
Return values
AddResult —Contains ID of inserted row
addMulti()
public
static addMulti(mixed $rows[, bool $ignoreEvents = false ]) : AddResult
Parameters
- $rows : mixed
- $ignoreEvents : bool = false
Tags
Return values
AddResultcheckFields()
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
cleanCache()
Cleans the tablet cache after data modifications.
public
static cleanCache() : void
compileEntity()
public
static compileEntity(mixed $type) : Entity
Parameters
- $type : mixed
Return values
EntitycompileItemFieldsContextEntity()
public
static compileItemFieldsContextEntity(mixed $type) : Entity
Parameters
- $type : mixed
Return values
EntitycompileItemIndexEntity()
public
static compileItemIndexEntity(mixed $type) : Entity
Parameters
- $type : mixed
Return values
EntitycreateCollection()
public
static createCollection() : EO_Type_Collection
Return values
EO_Type_CollectioncreateItemFieldsContextTable()
public
static createItemFieldsContextTable(mixed $type) : Result
Parameters
- $type : mixed
Return values
ResultcreateItemIndexTable()
public
static createItemIndexTable(mixed $type) : Result
Parameters
- $type : mixed
Return values
ResultcreateItemIndexTableInAgent()
public
static createItemIndexTableInAgent(mixed $type) : string
Parameters
- $type : mixed
Return values
stringcreateObject()
public
static createObject([mixed $setDefaultValues = = 'true' ]) : Type
Parameters
- $setDefaultValues : mixed = = 'true'
Return values
TypecryptoEnabled()
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
booldelete()
Deletes row in entity table by primary key
public
static delete(mixed $primary) : DeleteResult
Parameters
- $primary : mixed
Tags
Return values
DeleteResultdeleteEntityAutomation()
public
static deleteEntityAutomation(int $entityTypeId) : void
Parameters
- $entityTypeId : int
deleteItemFieldsContextTable()
public
static deleteItemFieldsContextTable(mixed $type) : Result
Parameters
- $type : mixed
Return values
ResultdeleteItemIndexTable()
public
static deleteItemIndexTable(mixed $type) : Result
Parameters
- $type : mixed
Return values
ResultenableCrypto()
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
generateName()
public
static generateName([string $title = null ][, int $try = 0 ]) : string|null
Parameters
- $title : string = null
- $try : int = 0
Return values
string|nullgetByEntityTypeId()
public
static getByEntityTypeId(int $entityTypeId) : Result
Parameters
- $entityTypeId : int
Return values
ResultgetById()
Returns selection by entity's primary key
public
static getById(mixed $id) : EO_Type_Result
Parameters
- $id : mixed
-
Primary key of the entity
Return values
EO_Type_ResultgetByPrimary()
Returns selection by entity's primary key and optional parameters for getList()
public
static getByPrimary(mixed $primary[, array<string|int, mixed> $parameters = = '[]' ]) : EO_Type_Result
Parameters
- $primary : mixed
-
Primary key of the entity
- $parameters : array<string|int, mixed> = = '[]'
-
Additional parameters for getList()
Return values
EO_Type_ResultgetCollectionClass()
Returns class of Object collection for current entity.
public
static getCollectionClass() : string|Collection
Return values
string|CollectiongetCollectionClassName()
Returns class name (without namespace) of Object collection for current entity.
public
final static getCollectionClassName() : string
Return values
stringgetCollectionParentClass()
public
static getCollectionParentClass() : Collection|string
Return values
Collection|stringgetConnectionName()
Returns connection name for entity
public
static getConnectionName() : string
Return values
stringgetCount()
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
Return values
intgetEntity()
Returns entity object
public
static getEntity() : EO_Type_Entity
Return values
EO_Type_EntitygetEntityClass()
public
static getEntityClass() : Entity|string
Return values
Entity|stringgetFactory()
public
static getFactory() : TypeFactory
Return values
TypeFactorygetFieldsInfo()
public
static getFieldsInfo() : array<string|int, mixed>
Return values
array<string|int, 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 = = '[]' ]) : EO_Type_Result
Parameters
- $parameters : array<string|int, mixed> = = '[]'
-
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.
Return values
EO_Type_ResultgetMap()
Returns entity map definition.
public
static getMap() : array<string|int, mixed>
To get initialized fields @see \Bitrix\Main\ORM\Entity::getFields() and \Bitrix\Main\ORM\Entity::getField()
Return values
array<string|int, mixed>getMultipleValueTableName()
public
static getMultipleValueTableName(mixed $type, mixed $userField) : string
Parameters
- $type : mixed
- $userField : mixed
Return values
stringgetNextAvailableEntityTypeId()
public
static getNextAvailableEntityTypeId() : int|null
Return values
int|nullgetObjectClass()
Returns class of Object for current entity.
public
static getObjectClass() : Entity|string
Return values
Entity|stringgetObjectClassName()
Returns class name (without namespace) of Object for current entity.
public
final static getObjectClassName() : string
Return values
stringgetObjectParentClass()
public
static getObjectParentClass() : EntityObject|string
Return values
EntityObject|stringgetQueryClass()
public
static getQueryClass() : Query|string
Return values
Query|stringgetRow()
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
Return values
array<string|int, mixed>|nullgetRowById()
Returns one row (or null) by entity's primary key
public
static getRowById(mixed $id) : array<string|int, mixed>|null
Parameters
- $id : mixed
-
Primary key of the entity
Tags
Return values
array<string|int, mixed>|nullgetTableName()
Returns DB table name for entity
public
static getTableName() : string
Return values
stringgetTitle()
public
static getTitle() : string|null
Return values
string|nullgetUfId()
public
static getUfId() : mixed
getUtmEntityClassName()
public
static getUtmEntityClassName(Entity $typeEntity, mixed $userField) : string
Parameters
- $typeEntity : Entity
- $userField : mixed
Return values
stringisCacheable()
You can disable cache for the tablet completely.
public
static isCacheable() : bool
Return values
boolisCreatingInProgress()
public
static isCreatingInProgress(int $entityTypeId) : bool
Parameters
- $entityTypeId : int
Return values
boolisUtm()
public
static isUtm() : mixed
isUts()
public
static isUts() : mixed
onAdd()
public
static onAdd(Event $event) : mixed
Parameters
- $event : Event
onAfterAdd()
public
static onAfterAdd(Event $event) : EventResult
Parameters
- $event : Event
Return values
EventResultonAfterDelete()
public
static onAfterDelete(Event $event) : EventResult
Parameters
- $event : Event
Return values
EventResultonAfterUpdate()
public
static onAfterUpdate(Event $event) : EventResult
Parameters
- $event : Event
Return values
EventResultonBeforeAdd()
public
static onBeforeAdd(Event $event) : EventResult
Parameters
- $event : Event
Return values
EventResultonBeforeDelete()
public
static onBeforeDelete(Event $event) : EventResult
Parameters
- $event : Event
Return values
EventResultonBeforeUpdate()
public
static onBeforeUpdate(Event $event) : EventResult
Parameters
- $event : Event
Return values
EventResultonDelete()
public
static onDelete(Event $event) : mixed
Parameters
- $event : Event
onUpdate()
public
static onUpdate(Event $event) : mixed
Parameters
- $event : Event
postInitialize()
public
static postInitialize(Entity $entity) : null
Parameters
- $entity : Entity
Return values
nullquery()
Creates and returns the Query object for the entity
public
static query() : EO_Type_Query
Return values
EO_Type_QueryresolveType()
public
static resolveType(array<string|int, mixed>|int|string|Type $type) : array<string|int, mixed>|null
Parameters
- $type : array<string|int, mixed>|int|string|Type
-
Could be an object, an array, ID or NAME of block.
Return values
array<string|int, mixed>|nullsetCurrentDeletingObject()
public
static setCurrentDeletingObject(EntityObject $object) : void
Parameters
- $object : EntityObject
setDefaultScope()
public
static setDefaultScope(Query $query) : Query
Parameters
- $query : Query
Return values
QueryunsetEntity()
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
Return values
UpdateResultupdateMulti()
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
Return values
UpdateResultvalidateEntityTypeId()
public
static validateEntityTypeId(mixed $value, mixed $primary, array<string|int, mixed> $row, Field $field) : mixed
Parameters
- $value : mixed
- $primary : mixed
- $row : array<string|int, mixed>
- $field : Field
validateTableExisting()
public
static validateTableExisting(mixed $value, mixed $primary, array<string|int, mixed> $row, Field $field) : mixed
Parameters
- $value : mixed
- $primary : mixed
- $row : array<string|int, mixed>
- $field : Field
wakeUpCollection()
public
static wakeUpCollection(mixed $rows) : EO_Type_Collection
Parameters
- $rows : mixed
Return values
EO_Type_CollectionwakeUpObject()
public
static wakeUpObject(mixed $row) : Type
Parameters
- $row : mixed