Bitrix API

SessionTable extends DataManager

Class SessionTable

Fields:

  • ID int mandatory
  • MODE string(255) default 'input'
  • SOURCE string(255) optional
  • STATUS int optional
  • CONFIG_ID int optional
  • USER_ID int mandatory
  • OPERATOR_ID int mandatory
  • USER_CODE string(255) optional
  • CHAT_ID int mandatory
  • MESSAGE_COUNT int optional
  • START_ID int mandatory
  • END_ID int mandatory
  • CRM bool optional default 'N'
  • CRM_CREATE bool optional default 'N'
  • CRM_ACTIVITY_ID int optional
  • DATE_CREATE datetime optional
  • DATE_MODIFY datetime optional
  • WAIT_ANSWER bool optional default 'Y'
  • WAIT_ACTION bool optional default 'N'
  • VOTE_ACTION bool optional default 'N'
  • CLOSED bool optional default 'N'
  • PAUSE bool optional default 'N'
  • WORKTIME bool optional default 'Y'
  • QUEUE_HISTORY string optional
  • VOTE int optional
  • VOTE_HEAD int optional
  • COMMENT_HEAD text optional

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
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_Session_Collection
createObject()  : EO_Session
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.
generateSearchContent()  : string
getById()  : EO_Session_Result
Returns selection by entity's primary key
getByIdPerformance()  : Result
Returns selection by entity's primary key without slow fields
getByPrimary()  : EO_Session_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.
getCurrentDate()  : DateTime
Return current date for DATE_CREATE field.
getEntity()  : EO_Session_Entity
Returns entity object
getEntityClass()  : Entity|string
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, Field>
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
getSelectFieldsPerformance()  : array<string|int, string>
Returns fields for select without slow fields
getTableName()  : string
Returns DB table name for entity.
getTitle()  : string|null
getUfId()  : string
indexRecord()  : mixed
isCacheable()  : bool
You can disable cache for the tablet completely.
isUtm()  : mixed
isUts()  : mixed
onAdd()  : mixed
onAfterAdd()  : EventResult
onAfterDelete()  : mixed
onAfterUpdate()  : EventResult
onBeforeAdd()  : mixed
onBeforeDelete()  : mixed
onBeforeUpdate()  : mixed
onDelete()  : mixed
onUpdate()  : mixed
postInitialize()  : null
query()  : EO_Session_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
validateExtraPortalType()  : array<string|int, Validator>
Returns validators for EXTRA_PORTAL_TYPE field.
validateExtraTariff()  : array<string|int, Validator>
Returns validators for EXTRA_TARIFF field.
validateExtraUrl()  : array<string|int, Validator>
Returns validators for EXTRA_URL field.
validateExtraUserLevel()  : array<string|int, Validator>
Returns validators for EXTRA_USER_LEVEL field.
validateMode()  : array<string|int, Validator>
Returns validators for SOURCE field.
validateSendForm()  : array<string|int, Validator>
Returns validators for SEND_FORM field.
validateSource()  : array<string|int, Validator>
Returns validators for SOURCE field.
validateUserCode()  : array<string|int, Validator>
Returns validators for USER_CODE field.
wakeUpCollection()  : EO_Session_Collection
wakeUpObject()  : EO_Session

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.

Tags
throws
Exception
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
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_Session_Collection
Return values
EO_Session_Collection

createObject()

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

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

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

generateSearchContent()

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

Record as returned by getList

Return values
string

getById()

Returns selection by entity's primary key

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

Primary key of the entity

Return values
EO_Session_Result

getByIdPerformance()

Returns selection by entity's primary key without slow fields

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

Primary key of the entity

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 = = '[]' ]) : EO_Session_Result
Parameters
$primary : mixed

Primary key of the entity

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

Additional parameters for getList()

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

getCurrentDate()

Return current date for DATE_CREATE field.

public static getCurrentDate() : DateTime
Return values
DateTime

getEntity()

Returns entity object

public static getEntity() : EO_Session_Entity
Return values
EO_Session_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 = [] ]) : Result
Parameters
$parameters : array<string|int, mixed> = []
Return values
Result

getMap()

Returns entity map definition.

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

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>|null
Parameters
$id : mixed

Primary key of the entity

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

getSelectFieldsPerformance()

Returns fields for select without slow fields

public static getSelectFieldsPerformance([string $prefix = '' ]) : array<string|int, string>
Parameters
$prefix : string = ''
Return values
array<string|int, string>

getTableName()

Returns DB table name for entity.

public static getTableName() : string
Return values
string

getTitle()

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

getUfId()

public static getUfId() : string
Return values
string

indexRecord()

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

isCacheable()

You can disable cache for the tablet completely.

public static isCacheable() : bool
Return values
bool

onBeforeUpdate()

public static onBeforeUpdate(Event $event) : mixed
Parameters
$event : Event

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_Session_Query
Return values
EO_Session_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

validateExtraPortalType()

Returns validators for EXTRA_PORTAL_TYPE field.

public static validateExtraPortalType() : array<string|int, Validator>
Return values
array<string|int, Validator>

validateExtraTariff()

Returns validators for EXTRA_TARIFF field.

public static validateExtraTariff() : array<string|int, Validator>
Return values
array<string|int, Validator>

validateExtraUrl()

Returns validators for EXTRA_URL field.

public static validateExtraUrl() : array<string|int, Validator>
Return values
array<string|int, Validator>

validateExtraUserLevel()

Returns validators for EXTRA_USER_LEVEL field.

public static validateExtraUserLevel() : array<string|int, Validator>
Return values
array<string|int, Validator>

validateMode()

Returns validators for SOURCE field.

public static validateMode() : array<string|int, Validator>
Return values
array<string|int, Validator>

validateSendForm()

Returns validators for SEND_FORM field.

public static validateSendForm() : array<string|int, Validator>
Return values
array<string|int, Validator>

validateSource()

Returns validators for SOURCE field.

public static validateSource() : array<string|int, Validator>
Return values
array<string|int, Validator>

validateUserCode()

Returns validators for USER_CODE field.

public static validateUserCode() : array<string|int, Validator>
Return values
array<string|int, Validator>

wakeUpCollection()

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

wakeUpObject()

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

        
On this page

Search results