Bitrix API

MessageTable extends DataManager

Class MessageTable

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"

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_Message_Collection
createObject()  : EO_Message
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.
getAllDailyCount()  : array<string|int, mixed>
getByExternalId()  : mixed
getById()  : EO_Message_Result
Returns selection by entity's primary key
getByPrimary()  : EO_Message_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.
getDailyCount()  : int
getEntity()  : EO_Message_Entity
Returns entity object
getEntityClass()  : Entity|string
getList()  : EO_Message_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()  : mixed
onBeforeDelete()  : mixed
onBeforeUpdate()  : mixed
onDelete()  : mixed
onUpdate()  : mixed
postInitialize()  : null
query()  : EO_Message_Query
Creates and returns the Query object for the entity
returnDeferredToQueue()  : bool
setCurrentDeletingObject()  : void
setDefaultScope()  : Query
unsetEntity()  : mixed
update()  : UpdateResult
Updates row in entity table by primary key
updateMessageStatuses()  : bool
updateMulti()  : UpdateResult
updateStatusId()  : bool
Updates message to the new status and returns result of update.
validateExecError()  : array<string|int, mixed>
Returns validators for EXEC_ERROR field.
validateExternalId()  : array<string|int, mixed>
Returns validators for EXTERNAL_ID field.
validateExternalStatus()  : array<string|int, mixed>
Returns validators for EXTERNAL_STATUS field.
validateMessageFrom()  : array<string|int, mixed>
Returns validators for MESSAGE_FROM field.
validateMessageTo()  : array<string|int, mixed>
Returns validators for MESSAGE_TO field.
validateSenderId()  : array<string|int, mixed>
Returns validators for SENDER_ID field.
validateType()  : array<string|int, mixed>
Returns validators for TYPE field.
wakeUpCollection()  : EO_Message_Collection
wakeUpObject()  : EO_Message

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_Message_Collection
Return values
EO_Message_Collection

createObject()

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

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

getAllDailyCount()

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

getByExternalId()

public static getByExternalId(string $senderId, string $externalId[, string|null $from = null ]) : mixed
Parameters
$senderId : string
$externalId : string
$from : string|null = null

getById()

Returns selection by entity's primary key

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

Primary key of the entity

Return values
EO_Message_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_Message_Result
Parameters
$primary : mixed

Primary key of the entity

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

Additional parameters for getList()

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

getDailyCount()

public static getDailyCount(mixed $senderId, mixed $fromId) : int
Parameters
$senderId : mixed
$fromId : mixed
Return values
int

getEntity()

Returns entity object

public static getEntity() : EO_Message_Entity
Return values
EO_Message_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_Message_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_Message_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>|null
Parameters
$id : mixed

Primary key of the entity

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

onAfterAdd()

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

onAfterDelete()

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

onAfterUpdate()

public static onAfterUpdate(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_Message_Query
Return values
EO_Message_Query

returnDeferredToQueue()

public static returnDeferredToQueue(mixed $senderId, mixed $fromId) : bool
Parameters
$senderId : mixed
$fromId : mixed
Return values
bool

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

updateMessageStatuses()

public static updateMessageStatuses(mixed $id, mixed $newInternalStatusId, mixed $newExternalStatus) : bool
Parameters
$id : mixed
$newInternalStatusId : mixed
$newExternalStatus : mixed
Return values
bool

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

updateStatusId()

Updates message to the new status and returns result of update.

public static updateStatusId(int $id, int $newStatusId) : bool
Parameters
$id : int

Id of the message.

$newStatusId : int

New status id.

Return values
bool

True if updated successfully and false otherwise (for example, if the message already was in this status).

validateExecError()

Returns validators for EXEC_ERROR field.

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

validateExternalId()

Returns validators for EXTERNAL_ID field.

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

validateExternalStatus()

Returns validators for EXTERNAL_STATUS field.

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

validateMessageFrom()

Returns validators for MESSAGE_FROM field.

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

validateMessageTo()

Returns validators for MESSAGE_TO field.

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

validateSenderId()

Returns validators for SENDER_ID field.

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

validateType()

Returns validators for TYPE field.

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

wakeUpCollection()

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

wakeUpObject()

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

        
On this page

Search results