Bitrix API

Collection

Class Collection This class represents collection of database objects such as table columns or indexes, schema procedures or sequences.

Table of Contents

Methods

add()  : void
Add object into the tail of the collection.
compare()  : array<string|int, mixed>
Compares two collections of objects and returns array of pairs.
getList()  : mixed
Returns all collection objects.
search()  : BaseObject|null
Searches collection for an object by it's name.
searchIndex()  : int|null
Searches collection for an object by it's name.
set()  : void
Replaces object in the collection.

Methods

compare()

Compares two collections of objects and returns array of pairs.

public compare(Collection $targetList[, bool $compareBody = true ]) : array<string|int, mixed>

Pair is the two element array: - First element with index "0" is the object from the source collection. - Second element with index "1" is the object from $targetList. - if pair element is null when no such element found (by name) in the collection.

Parameters
$targetList : Collection

Collection to compare.

$compareBody : bool = true

Whenever to compare objects bodies or not.

Return values
array<string|int, mixed>

getList()

Returns all collection objects.

public getList() : mixed

Searches collection for an object by it's name.

public search(string $name) : BaseObject|null
Parameters
$name : string

Object name to look up.

Return values
BaseObject|null

searchIndex()

Searches collection for an object by it's name.

public searchIndex(string $name) : int|null
Parameters
$name : string

Object name to look up.

Return values
int|null

set()

Replaces object in the collection.

public set(int $index, BaseObject $object) : void
Parameters
$index : int

Collection index for replacement.

$object : BaseObject

Object to add.


        
On this page

Search results