Bitrix API

PropertyTable extends DataManager

Class PropertyTable

Fields:

  • ID int mandatory
  • TIMESTAMP_X datetime mandatory default 'CURRENT_TIMESTAMP'
  • IBLOCK_ID int mandatory
  • NAME string(255) mandatory
  • ACTIVE bool optional default 'Y'
  • SORT int optional default 500
  • CODE string(50) optional
  • DEFAULT_VALUE text optional
  • PROPERTY_TYPE enum ('S', 'N', 'L', 'F', 'E' or 'G') optional default 'S'
  • ROW_COUNT int optional default 1
  • COL_COUNT int optional default 30
  • LIST_TYPE enum ('C' or 'L') optional default 'L'
  • MULTIPLE bool optional default 'N'
  • XML_ID string(100) optional
  • FILE_TYPE string(200) optional
  • MULTIPLE_CNT int optional
  • TMP_ID string(40) optional
  • LINK_IBLOCK_ID int optional
  • WITH_DESCRIPTION bool optional default 'N'
  • SEARCHABLE bool optional default 'N'
  • FILTRABLE bool optional default 'N'
  • IS_REQUIRED bool optional default 'N'
  • VERSION enum (1 or 2) optional default 1
  • USER_TYPE string(255) optional
  • USER_TYPE_SETTINGS string optional
  • HINT string(255) optional
  • LINK_IBLOCK reference to [](\Bitrix\Iblock\IblockTable)
  • IBLOCK reference to [](\Bitrix\Iblock\IblockTable)

Table of Contents

Constants

CHECKBOX  = 'C'
DEFAULT_MULTIPLE_CNT  = 5
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"
LISTBOX  = 'L'
TYPE_ELEMENT  = 'E'
TYPE_FILE  = 'F'
TYPE_LIST  = 'L'
TYPE_NUMBER  = 'N'
TYPE_SECTION  = 'G'
TYPE_STRING  = 'S'
USER_TYPE_CRM  = 'ECrm'
USER_TYPE_DATE  = 'Date'
USER_TYPE_DATETIME  = 'DateTime'
USER_TYPE_DIRECTORY  = 'directory'
USER_TYPE_DISK  = 'DiskFile'
USER_TYPE_ELEMENT_AUTOCOMPLETE  = 'EAutocomplete'
USER_TYPE_ELEMENT_LIST  = 'EList'
USER_TYPE_EMPLOYEE  = 'employee'
USER_TYPE_FILE_MAN  = 'FileMan'
USER_TYPE_FORUM_TOPIC  = 'TopicID'
USER_TYPE_GOOGLE_MAP  = 'map_google'
USER_TYPE_HTML  = 'HTML'
USER_TYPE_MONEY  = 'Money'
USER_TYPE_SECTION_AUTOCOMPLETE  = 'SectionAuto'
USER_TYPE_SEQUENCE  = 'Sequence'
USER_TYPE_SKU  = 'SKU'
USER_TYPE_USER  = 'UserID'
USER_TYPE_XML_ID  = 'ElementXmlID'
USER_TYPE_YANDEX_MAP  = 'map_yandex'

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.
createCollection()  : EO_Property_Collection
createObject()  : Property
cryptoEnabled()  : bool
Returns true if crypto is enabled for a field.
defaultValueFetchModifier()  : array<string|int, mixed>|null
Fetch modifier for user type default value from old iblock core.
delete()  : DeleteResult
Deletes row in entity table by primary key
enableCrypto()  : mixed
Sets a flag indicating crypto support for a field.
fillOldCoreFetchModifiers()  : void
Add fetch modifiers for emulate old iblock core.
getById()  : EO_Property_Result
Returns selection by entity's primary key
getByPrimary()  : EO_Property_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_Property_Entity
Returns entity object
getEntityClass()  : Entity|string
getList()  : EO_Property_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()  : mixed
onAfterDelete()  : mixed
onAfterUpdate()  : mixed
onBeforeAdd()  : EventResult
Default onBeforeAdd handler. Absolutely necessary.
onBeforeDelete()  : mixed
onBeforeUpdate()  : EventResult
Default onBeforeUpdate handler. Absolutely necessary.
onDelete()  : mixed
onUpdate()  : mixed
postInitialize()  : null
query()  : EO_Property_Query
Creates and returns the Query object for the entity
setCurrentDeletingObject()  : void
setDefaultScope()  : Query
unsetEntity()  : mixed
update()  : UpdateResult
Updates row in entity table by primary key
updateMulti()  : UpdateResult
userTypeSettingsFetchModifer()  : array<string|int, mixed>|null
Fetch modifier for user type settings from old iblock core.
wakeUpCollection()  : EO_Property_Collection
wakeUpObject()  : Property

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"

USER_TYPE_DATETIME

public mixed USER_TYPE_DATETIME = 'DateTime'

USER_TYPE_DIRECTORY

public mixed USER_TYPE_DIRECTORY = 'directory'

USER_TYPE_ELEMENT_AUTOCOMPLETE

public mixed USER_TYPE_ELEMENT_AUTOCOMPLETE = 'EAutocomplete'

USER_TYPE_ELEMENT_LIST

public mixed USER_TYPE_ELEMENT_LIST = 'EList'

USER_TYPE_EMPLOYEE

public mixed USER_TYPE_EMPLOYEE = 'employee'

USER_TYPE_FILE_MAN

public mixed USER_TYPE_FILE_MAN = 'FileMan'

USER_TYPE_FORUM_TOPIC

public mixed USER_TYPE_FORUM_TOPIC = 'TopicID'

USER_TYPE_GOOGLE_MAP

public mixed USER_TYPE_GOOGLE_MAP = 'map_google'

USER_TYPE_SECTION_AUTOCOMPLETE

public mixed USER_TYPE_SECTION_AUTOCOMPLETE = 'SectionAuto'

USER_TYPE_SEQUENCE

public mixed USER_TYPE_SEQUENCE = 'Sequence'

USER_TYPE_XML_ID

public mixed USER_TYPE_XML_ID = 'ElementXmlID'

USER_TYPE_YANDEX_MAP

public mixed USER_TYPE_YANDEX_MAP = 'map_yandex'

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

cleanCache()

Cleans the tablet cache after data modifications.

public static cleanCache() : void

createCollection()

public static createCollection() : EO_Property_Collection
Return values
EO_Property_Collection

createObject()

public static createObject([mixed $setDefaultValues = = 'true' ]) : Property
Parameters
$setDefaultValues : mixed = = 'true'
Return values
Property

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

defaultValueFetchModifier()

Fetch modifier for user type default value from old iblock core.

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

Fetch result fields.

Return values
array<string|int, mixed>|null

delete()

Deletes row in entity table by primary key

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

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

fillOldCoreFetchModifiers()

Add fetch modifiers for emulate old iblock core.

public static fillOldCoreFetchModifiers(Result $result) : void
Parameters
$result : Result

getList result.

getById()

Returns selection by entity's primary key

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

Primary key of the entity

Return values
EO_Property_Result

getByPrimary()

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

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

Primary key of the entity

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

Additional parameters for getList()

Return values
EO_Property_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

getEntity()

Returns entity object

public static getEntity() : EO_Property_Entity
Return values
EO_Property_Entity

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_Property_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_Property_Result

getMap()

Returns entity map definition.

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

getObjectClassName()

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

public final static getObjectClassName() : string
Return values
string

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

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

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() : EO_Property_Query
Return values
EO_Property_Query

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

userTypeSettingsFetchModifer()

Fetch modifier for user type settings from old iblock core.

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

Fetch result fields.

Return values
array<string|int, mixed>|null

wakeUpCollection()

public static wakeUpCollection(mixed $rows) : EO_Property_Collection
Parameters
$rows : mixed
Return values
EO_Property_Collection

wakeUpObject()

public static wakeUpObject(mixed $row) : Property
Parameters
$row : mixed
Return values
Property

        
On this page

Search results