Bitrix API

RelationCollection extends Collection

Tags
implements
implements

Table of Contents

Constants

COMMON_FIELDS  = ['ID', 'MESSAGE_TYPE', 'CHAT_ID', 'USER_ID', 'START_ID', 'LAST_FILE_ID', 'LAST_ID', 'LAST_SEND_MESSAGE_ID', 'UNREAD_ID', 'NOTIFY_BLOCK', 'MANAGER', 'REASON']

Methods

__construct()  : mixed
add()  : static
Append collection with new item.
createFake()  : self
delete()  : Result
Delete from the database all entities that are in the registry and have an id
filter()  : $this
filterActive()  : self
filterNotifySubscribed()  : self
find()  : static
getAny()  : T|null
getByUserId()  : Relation|null
getCollectionElementClass()  : string|ActiveRecord
Returns collection item's class name.
getDataClass()  : string|DataManager
Returns ORM tablet class name.
getDataEntityCollection()  : Collection
Before external call, call prepare method to update the state of the entity @see BaseLinkCollection::prepareFields()
getPrimaryIds()  : array<string|int, int>
getStartId()  : int
getUserIds()  : array<string|int, mixed>
getUsers()  : UserCollection
hasUnsaved()  : bool
hasUser()  : bool
load()  : Result
Restores object state from database.
merge()  : static
offsetGet()  : Relation
offsetSet()  : void
Alias to add method.
offsetUnset()  : mixed
onAfterRelationDelete()  : void
save()  : Result
Saves collection objects states into database.
unsetByKeys()  : void

Constants

COMMON_FIELDS

public mixed COMMON_FIELDS = ['ID', 'MESSAGE_TYPE', 'CHAT_ID', 'USER_ID', 'START_ID', 'LAST_FILE_ID', 'LAST_ID', 'LAST_SEND_MESSAGE_ID', 'UNREAD_ID', 'NOTIFY_BLOCK', 'MANAGER', 'REASON']

Methods

__construct()

public __construct([mixed $source = null ]) : mixed
Parameters
$source : mixed = null

add()

Append collection with new item.

public add(ActiveRecord $entry) : static
Parameters
$entry : ActiveRecord
Tags
throws
ArgumentTypeException
Return values
static

createFake()

public static createFake(array<string|int, mixed> $userIds, Chat $chat) : self
Parameters
$userIds : array<string|int, mixed>
$chat : Chat
Return values
self

delete()

Delete from the database all entities that are in the registry and have an id

public delete() : Result
Return values
Result

filter()

public filter(callable $predicate) : $this
Parameters
$predicate : callable
Return values
$this

filterNotifySubscribed()

public filterNotifySubscribed() : self
Return values
self

find()

public static find(array<string|int, mixed> $filter[, array<string|int, mixed> $order = [] ][, int|null $limit = null ][, Context|null $context = null ][, array<string|int, mixed> $select = self::COMMON_FIELDS ]) : static
Parameters
$filter : array<string|int, mixed>
$order : array<string|int, mixed> = []
$limit : int|null = null
$context : Context|null = null
$select : array<string|int, mixed> = self::COMMON_FIELDS
Return values
static

getAny()

public getAny() : T|null
Return values
T|null

getDataEntityCollection()

Before external call, call prepare method to update the state of the entity @see BaseLinkCollection::prepareFields()

public getDataEntityCollection() : Collection
Return values
Collection

getPrimaryIds()

public getPrimaryIds() : array<string|int, int>
Return values
array<string|int, int>

getStartId()

public static getStartId(int $userId, int $chatId) : int
Parameters
$userId : int
$chatId : int
Return values
int

getUserIds()

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

hasUnsaved()

public hasUnsaved() : bool
Return values
bool

hasUser()

public hasUser(int $userId, int $chatId) : bool
Parameters
$userId : int
$chatId : int
Return values
bool

load()

Restores object state from database.

public load(array<string|int, int>|array<string|int, mixed>|Collection $source) : Result
Parameters
$source : array<string|int, int>|array<string|int, mixed>|Collection
Return values
Result

merge()

public merge(Registry<string|int, T$registry) : static
Parameters
$registry : Registry<string|int, T>
Return values
static

offsetSet()

Alias to add method.

public offsetSet(mixed $key, mixed $value) : void
Parameters
$key : mixed
$value : mixed

onAfterRelationDelete()

public onAfterRelationDelete(int $chatId, int $userId) : void
Parameters
$chatId : int
$userId : int

save()

Saves collection objects states into database.

public save([bool $isGroupSave = false ]) : Result
Parameters
$isGroupSave : bool = false
Return values
Result

unsetByKeys()

public unsetByKeys(array<string|int, mixed> $keys) : void
Parameters
$keys : array<string|int, mixed>

        
On this page

Search results