Bitrix API

Collection implements Arrayable, Iterator, Countable

FinalYes

Table of Contents

Interfaces

Arrayable
Iterator
Countable

Methods

__clone()  : mixed
add()  : $this
Add a new value to the collection.
count()  : int
current()  : Value|false
filterByType()  : self
Returns **new** collection with values that belong to type with the provided $typeId.
getAll()  : array<string|int, Value>
Get a flat array with all values contained in this collection
getById()  : Value|null
has()  : bool
isEmpty()  : bool
isEqualTo()  : bool
key()  : int|null
next()  : void
remove()  : self
removeById()  : self
rewind()  : void
toArray()  : array<string|int, mixed>
valid()  : bool

Methods

add()

Add a new value to the collection.

public add(Value $value) : $this

If an equal value is already in this collection, duplicating value won't be added.

Parameters
$value : Value
Return values
$this

filterByType()

Returns **new** collection with values that belong to type with the provided $typeId.

public filterByType(string $typeId) : self

This collection is not mutated. References to values are not shared.

Parameters
$typeId : string
Return values
self

getAll()

Get a flat array with all values contained in this collection

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

isEmpty()

public isEmpty() : bool
Return values
bool

isEqualTo()

public isEqualTo(self $anotherCollection) : bool
Parameters
$anotherCollection : self
Return values
bool

key()

public key() : int|null
Return values
int|null

removeById()

public removeById(int $id) : self
Parameters
$id : int
Return values
self

toArray()

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

valid()

public valid() : bool
Return values
bool

        
On this page

Search results