Bitrix API

Collection implements Iterator, Countable

Table of Contents

Interfaces

Iterator
Countable

Methods

__construct()  : mixed
Collection constructor.
add()  : $this
Add the relation to the collection If a similar relation already present in the collection, the new one will not be added But if the new relation is predefined, it will replace the old one
count()  : int
current()  : Relation|null
filterByChildEntityTypeId()  : Collection
Returns a new collection filtered by Relation::getChildEntityTypeId === $childEntityTypeId
filterByEntityTypeId()  : Collection
Returns a new collection filtered by Relation::getParentEntityTypeId === $parentEntityTypeId OR Relation::getChildEntityTypeId === $childEntityTypeId
filterByParentEntityTypeId()  : Collection
Returns a new collection filtered by Relation::getParentEntityTypeId === $parentEntityTypeId
filterOutCustomRelations()  : Collection
Returns a new collection where not predefined relations are removed
filterOutPredefinedRelations()  : Collection
Returns a new collection where predefined relations are removed
get()  : Relation|null
Returns a relation specified by the identifier If such a relation does not exist in the collection, returns null
isEmpty()  : bool
Returns true if this collection contains no relations
key()  : int
merge()  : Collection
Returns a new collection that contains all unique relations from this and the provided collections
next()  : void
remove()  : $this
Remove a relation from the collection
rewind()  : void
toArray()  : array<string|int, Relation>
Transform this collection to array
valid()  : bool

Methods

__construct()

Collection constructor.

public __construct([array<string|int, Relation$relations = [] ]) : mixed
Parameters
$relations : array<string|int, Relation> = []

add()

Add the relation to the collection If a similar relation already present in the collection, the new one will not be added But if the new relation is predefined, it will replace the old one

public add(Relation $relation) : $this
Parameters
$relation : Relation
Return values
$this

count()

public count() : int
Tags
inheritDoc
Return values
int

current()

public current() : Relation|null
Tags
inheritDoc
Return values
Relation|null

filterByChildEntityTypeId()

Returns a new collection filtered by Relation::getChildEntityTypeId === $childEntityTypeId

public filterByChildEntityTypeId(int $childEntityTypeId) : Collection

Relation objects are NOT cloned

Parameters
$childEntityTypeId : int
Return values
Collection

filterByEntityTypeId()

Returns a new collection filtered by Relation::getParentEntityTypeId === $parentEntityTypeId OR Relation::getChildEntityTypeId === $childEntityTypeId

public filterByEntityTypeId(int $entityTypeId) : Collection

Relation objects are NOT cloned

Parameters
$entityTypeId : int
Return values
Collection

filterByParentEntityTypeId()

Returns a new collection filtered by Relation::getParentEntityTypeId === $parentEntityTypeId

public filterByParentEntityTypeId(int $parentEntityTypeId) : Collection

Relation objects are NOT cloned

Parameters
$parentEntityTypeId : int
Return values
Collection

filterOutCustomRelations()

Returns a new collection where not predefined relations are removed

public filterOutCustomRelations() : Collection

Relation objects are NOT cloned

Return values
Collection

filterOutPredefinedRelations()

Returns a new collection where predefined relations are removed

public filterOutPredefinedRelations() : Collection

Relation objects are NOT cloned

Return values
Collection

get()

Returns a relation specified by the identifier If such a relation does not exist in the collection, returns null

public get(RelationIdentifier $identifier) : Relation|null
Parameters
$identifier : RelationIdentifier
Return values
Relation|null

isEmpty()

Returns true if this collection contains no relations

public isEmpty() : bool
Return values
bool

key()

public key() : int
Tags
inheritDoc
Return values
int

remove()

Remove a relation from the collection

public remove(RelationIdentifier $identifier) : $this
Parameters
$identifier : RelationIdentifier
Return values
$this

rewind()

public rewind() : void
Tags
inheritDoc

toArray()

Transform this collection to array

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

valid()

public valid() : bool
Tags
inheritDoc
Return values
bool

        
On this page

Search results