IblockTable extends DataManager
Class IblockTable
Fields:
- ID int mandatory
- TIMESTAMP_X datetime
- IBLOCK_TYPE_ID string(50) mandatory
- CODE string(50) optional
- NAME string(255) mandatory
- ACTIVE bool optional default 'Y'
- SORT int optional default 500
- LIST_PAGE_URL string(255) optional
- DETAIL_PAGE_URL string(255) optional
- SECTION_PAGE_URL string(255) optional
- CANONICAL_PAGE_URL string(255) optional
- PICTURE int optional
- DESCRIPTION text optional
- DESCRIPTION_TYPE enum ('text', 'html') optional default 'text'
- XML_ID string(255) optional
- TMP_ID string(40) optional internal use only
- INDEX_ELEMENT bool optional default 'Y'
- INDEX_SECTION bool optional default 'N'
- WORKFLOW bool optional default 'Y'
- BIZPROC bool optional default 'N'
- SECTION_CHOOSER enum ('L', 'D' or 'P') optional default 'L'
- LIST_MODE enum ('S' or 'C') optional default ''
- RIGHTS_MODE enum ('S' or 'E') optional default 'S'
- SECTION_PROPERTY bool optional default 'N'
- PROPERTY_INDEX enum ('N', 'Y', 'I') optional default 'N'
- VERSION enum (1 or 2) optional default 1
- LAST_CONV_ELEMENT int optional default 0 internal use only
- SOCNET_GROUP_ID int optional internal use only
- EDIT_FILE_BEFORE string(255) optional
- EDIT_FILE_AFTER string(255) optional
- TYPE reference to [](\Bitrix\Iblock\TypeTable)
Table of Contents
Constants
- COMBINED = self::LIST_MODE_COMBINED
- DATA_CLASS_NAMESPACE = 'Bitrix\Iblock\Elements'
- DATA_CLASS_PREFIX = 'Element'
- DROPDOWNS = self::SECTION_CHOOSER_DROPDOWNS
- 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"
- EXTENDED = self::RIGHTS_EXTENDED
- INVALID = self::PROPERTY_INDEX_INVALID
- LIST_MODE_COMBINED = 'C'
- LIST_MODE_SEPARATE = 'S'
- PATH = self::SECTION_CHOOSER_PATH
- PROPERTY_INDEX_DISABLE = 'N'
- PROPERTY_INDEX_ENABLE = 'Y'
- PROPERTY_INDEX_INVALID = 'I'
- PROPERTY_STORAGE_COMMON = 1
- PROPERTY_STORAGE_SEPARATE = 2
- RIGHTS_EXTENDED = 'E'
- RIGHTS_SIMPLE = 'S'
- SECTION_CHOOSER_DROPDOWNS = 'D'
- SECTION_CHOOSER_PATH = 'P'
- SECTION_CHOOSER_SELECT = 'L'
- SELECT = self::SECTION_CHOOSER_SELECT
- SEPARATE = self::LIST_MODE_SEPARATE
- SIMPLE = self::RIGHTS_SIMPLE
- TYPE_HTML = 'html'
- TYPE_TEXT = 'text'
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
- cleanCache() : void
- Cleans the tablet cache after data modifications.
- compileAllEntities() : mixed
- compileEntity() : ElementEntity|false
- createCollection() : EO_Iblock_Collection
- createObject() : Iblock
- cryptoEnabled() : bool
- Returns true if crypto is enabled for a field.
- delete() : DeleteResult
- Deletes row in entity table by primary key
- enableCrypto() : mixed
- Sets a flag indicating crypto support for a field.
- getById() : EO_Iblock_Result
- Returns selection by entity's primary key
- getByPrimary() : EO_Iblock_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_Iblock_Entity
- Returns entity object
- getEntityClass() : Entity|string
- getList() : EO_Iblock_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.
- 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
- 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
- isCacheable() : bool
- You can disable cache for the tablet completely.
- isUtm() : mixed
- isUts() : mixed
- onAdd() : mixed
- onAfterAdd() : void
- Default onAfterAdd handler. Absolutely necessary.
- onAfterDelete() : void
- Default onAfterDelete handler. Absolutely necessary.
- onAfterUpdate() : void
- Default onAfterUpdate handler. Absolutely necessary.
- onBeforeAdd() : EventResult
- Default onBeforeAdd handler. Absolutely necessary.
- onBeforeDelete() : mixed
- onBeforeUpdate() : EventResult
- Default onBeforeUpdate handler. Absolutely necessary.
- onDelete() : mixed
- onUpdate() : mixed
- postInitialize() : null
- query() : EO_Iblock_Query
- Creates and returns the Query object for the entity
- resolveIdByCode() : int|null
- Returns iblock identifier by symbolic code. Optionally, checked site relation.
- setCurrentDeletingObject() : void
- setDefaultScope() : Query
- unsetEntity() : mixed
- update() : UpdateResult
- Updates row in entity table by primary key
- updateMulti() : UpdateResult
- wakeUpCollection() : EO_Iblock_Collection
- wakeUpObject() : Iblock
Constants
COMBINED
public
mixed
COMBINED
= self::LIST_MODE_COMBINED
DATA_CLASS_NAMESPACE
public
mixed
DATA_CLASS_NAMESPACE
= 'Bitrix\Iblock\Elements'
DATA_CLASS_PREFIX
public
mixed
DATA_CLASS_PREFIX
= 'Element'
DROPDOWNS
public
mixed
DROPDOWNS
= self::SECTION_CHOOSER_DROPDOWNS
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"
EXTENDED
public
mixed
EXTENDED
= self::RIGHTS_EXTENDED
INVALID
public
mixed
INVALID
= self::PROPERTY_INDEX_INVALID
LIST_MODE_COMBINED
public
mixed
LIST_MODE_COMBINED
= 'C'
LIST_MODE_SEPARATE
public
mixed
LIST_MODE_SEPARATE
= 'S'
PATH
public
mixed
PATH
= self::SECTION_CHOOSER_PATH
PROPERTY_INDEX_DISABLE
public
mixed
PROPERTY_INDEX_DISABLE
= 'N'
PROPERTY_INDEX_ENABLE
public
mixed
PROPERTY_INDEX_ENABLE
= 'Y'
PROPERTY_INDEX_INVALID
public
mixed
PROPERTY_INDEX_INVALID
= 'I'
PROPERTY_STORAGE_COMMON
public
mixed
PROPERTY_STORAGE_COMMON
= 1
PROPERTY_STORAGE_SEPARATE
public
mixed
PROPERTY_STORAGE_SEPARATE
= 2
RIGHTS_EXTENDED
public
mixed
RIGHTS_EXTENDED
= 'E'
RIGHTS_SIMPLE
public
mixed
RIGHTS_SIMPLE
= 'S'
SECTION_CHOOSER_DROPDOWNS
public
mixed
SECTION_CHOOSER_DROPDOWNS
= 'D'
SECTION_CHOOSER_PATH
public
mixed
SECTION_CHOOSER_PATH
= 'P'
SECTION_CHOOSER_SELECT
public
mixed
SECTION_CHOOSER_SELECT
= 'L'
SELECT
public
mixed
SELECT
= self::SECTION_CHOOSER_SELECT
SEPARATE
public
mixed
SEPARATE
= self::LIST_MODE_SEPARATE
SIMPLE
public
mixed
SIMPLE
= self::RIGHTS_SIMPLE
TYPE_HTML
public
mixed
TYPE_HTML
= 'html'
TYPE_TEXT
public
mixed
TYPE_TEXT
= 'text'
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
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
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
compileAllEntities()
public
static compileAllEntities() : mixed
Tags
compileEntity()
public
static compileEntity(int|Iblock $iblockApiCode) : ElementEntity|false
Parameters
- $iblockApiCode : int|Iblock
Tags
Return values
ElementEntity|falsecreateCollection()
public
static createCollection() : EO_Iblock_Collection
Return values
EO_Iblock_CollectioncreateObject()
public
static createObject([mixed $setDefaultValues = = 'true' ]) : Iblock
Parameters
- $setDefaultValues : mixed = = 'true'
Return values
IblockcryptoEnabled()
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
DeleteResultenableCrypto()
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) : EO_Iblock_Result
Parameters
- $id : mixed
-
Primary key of the entity
Return values
EO_Iblock_ResultgetByPrimary()
Returns selection by entity's primary key and optional parameters for getList()
public
static getByPrimary(mixed $primary[, array<string|int, mixed> $parameters = = '[]' ]) : EO_Iblock_Result
Parameters
- $primary : mixed
-
Primary key of the entity
- $parameters : array<string|int, mixed> = = '[]'
-
Additional parameters for getList()
Return values
EO_Iblock_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_Iblock_Entity
Return values
EO_Iblock_EntitygetEntityClass()
public
static getEntityClass() : Entity|string
Return values
Entity|stringgetList()
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_Iblock_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_Iblock_ResultgetMap()
Returns entity map definition.
public
static getMap() : array<string|int, mixed>
Return values
array<string|int, mixed>getObjectClass()
Returns class of Object for current entity.
public
static getObjectClass() : string|EntityObject
Return values
string|EntityObjectgetObjectClassName()
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> $parameters = [] ]) : array<string|int, mixed>|null
Parameters
- $id : mixed
-
Primary key of the entity
- $parameters : array<string|int, mixed> = []
-
Additional parameters for getList()
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
isCacheable()
You can disable cache for the tablet completely.
public
static isCacheable() : bool
Return values
boolisUtm()
public
static isUtm() : mixed
isUts()
public
static isUts() : mixed
onAdd()
public
static onAdd(Event $event) : mixed
Parameters
- $event : Event
onAfterAdd()
Default onAfterAdd handler. Absolutely necessary.
public
static onAfterAdd(Event $event) : void
Parameters
- $event : Event
-
Current data for add.
onAfterDelete()
Default onAfterDelete handler. Absolutely necessary.
public
static onAfterDelete(Event $event) : void
Parameters
- $event : Event
-
Current data for add.
onAfterUpdate()
Default onAfterUpdate handler. Absolutely necessary.
public
static onAfterUpdate(Event $event) : void
Parameters
- $event : Event
-
Current data for add.
onBeforeAdd()
Default onBeforeAdd handler. Absolutely necessary.
public
static onBeforeAdd(Event $event) : EventResult
Parameters
- $event : Event
-
Current data for add.
Return values
EventResultonBeforeDelete()
public
static onBeforeDelete(Event $event) : mixed
Parameters
- $event : Event
onBeforeUpdate()
Default onBeforeUpdate handler. Absolutely necessary.
public
static onBeforeUpdate(Event $event) : EventResult
Parameters
- $event : Event
-
Current data for update.
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_Iblock_Query
Return values
EO_Iblock_QueryresolveIdByCode()
Returns iblock identifier by symbolic code. Optionally, checked site relation.
public
static resolveIdByCode(string $code[, string|null $siteId = null ]) : int|null
Parameters
- $code : string
-
Iblock symbolic code.
- $siteId : string|null = null
-
Site identifier.
Return values
int|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
UpdateResultwakeUpCollection()
public
static wakeUpCollection(mixed $rows) : EO_Iblock_Collection
Parameters
- $rows : mixed
Return values
EO_Iblock_CollectionwakeUpObject()
public
static wakeUpObject(mixed $row) : Iblock
Parameters
- $row : mixed