Bitrix API

Collection implements ArrayAccess, Iterator, Countable

AbstractYes

Collection of entity objects. Used to hold 1:N and N:M object collections.

Tags
subpackage

main

Table of Contents

Interfaces

ArrayAccess
Iterator
Countable

Constants

OBJECT_ADDED  = 1
OBJECT_REMOVED  = 2

Properties

$dataClass  : DataManager
Entity Table class. Read-only property.
$entity  : Entity

Methods

__call()  : array<string|int, mixed>
Magic to handle getters, setters etc.
__clone()  : mixed
__construct()  : mixed
Collection constructor.
__get()  : array<string|int, mixed>|Entity
Magic read-only properties
__set()  : mixed
Magic read-only properties
add()  : mixed
collectValues()  : array<string|int, mixed>
Returns all values of collection objects as an array.
count()  : int
Countable implementation
current()  : EntityObject|mixed
Iterator implementation
fill()  : array<string|int, mixed>|Collection|null
Fills all the values and relations of object
getAll()  : array<string|int, EntityObject>
getByPrimary()  : EntityObject
has()  : bool
hasByPrimary()  : bool
isEmpty()  : bool
key()  : mixed
Iterator implementation
merge()  : self
next()  : void
Iterator implementation
offsetExists()  : bool
ArrayAccess implementation
offsetGet()  : mixed|void
ArrayAccess implementation
offsetSet()  : void
ArrayAccess implementation
offsetUnset()  : void
ArrayAccess implementation
remove()  : void
removeByPrimary()  : mixed
rewind()  : void
Iterator implementation
save()  : mixed
sysOnObjectPrimarySet()  : mixed
Callback for object event when it gets primary
sysRemove()  : mixed
valid()  : bool
Iterator implementation
wakeUp()  : array<string|int, mixed>|static
Constructs set of existing objects from pre-selected data, including references and relations.

Constants

OBJECT_ADDED

public int OBJECT_ADDED = 1

Code for $objectsChanged

OBJECT_REMOVED

public int OBJECT_REMOVED = 2

Code for $objectsChanged

Properties

Methods

__call()

Magic to handle getters, setters etc.

public __call(mixed $name, mixed $arguments) : array<string|int, mixed>
Parameters
$name : mixed
$arguments : mixed
Tags
throws
ArgumentException
throws
SystemException
Return values
array<string|int, mixed>

__construct()

Collection constructor.

public final __construct([Entity $entity = null ]) : mixed
Parameters
$entity : Entity = null
Tags
throws
ArgumentException
throws
SystemException

__get()

Magic read-only properties

public __get(mixed $name) : array<string|int, mixed>|Entity
Parameters
$name : mixed
Tags
throws
SystemException
Return values
array<string|int, mixed>|Entity

__set()

Magic read-only properties

public __set(mixed $name, mixed $value) : mixed
Parameters
$name : mixed
$value : mixed
Tags
throws
SystemException

collectValues()

Returns all values of collection objects as an array.

public final collectValues([int $valuesType = Values::ALL ][, int $fieldsMask = FieldTypeMask::ALL ][, bool $recursive = false ]) : array<string|int, mixed>
Parameters
$valuesType : int = Values::ALL
$fieldsMask : int = FieldTypeMask::ALL
$recursive : bool = false
Tags
throws
SystemException
Return values
array<string|int, mixed>

count()

Countable implementation

public count() : int
Return values
int

fill()

Fills all the values and relations of object

public final fill([int|array<string|int, string> $fields = FieldTypeMask::ALL ]) : array<string|int, mixed>|Collection|null
Parameters
$fields : int|array<string|int, string> = FieldTypeMask::ALL

Names of fields to fill

Tags
throws
ArgumentException
throws
SystemException
Return values
array<string|int, mixed>|Collection|null

hasByPrimary()

public final hasByPrimary(mixed $primary) : bool
Parameters
$primary : mixed
Tags
throws
ArgumentException
Return values
bool

isEmpty()

public isEmpty() : bool
Return values
bool

key()

Iterator implementation

public key() : mixed
Attributes
#[ReturnTypeWillChange]

merge()

public merge(self|null $collection) : self
Parameters
$collection : self|null
Tags
throws
SystemException
throws
ArgumentException
Return values
self

next()

Iterator implementation

public next() : void

offsetExists()

ArrayAccess implementation

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Tags
throws
NotImplementedException
Return values
bool

offsetGet()

ArrayAccess implementation

public offsetGet(mixed $offset) : mixed|void
Parameters
$offset : mixed
Tags
throws
NotImplementedException
Attributes
#[ReturnTypeWillChange]
Return values
mixed|void

offsetSet()

ArrayAccess implementation

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed
Tags
throws
ArgumentException
throws
SystemException

offsetUnset()

ArrayAccess implementation

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed
Tags
throws
NotImplementedException

removeByPrimary()

public final removeByPrimary(mixed $primary) : mixed
Parameters
$primary : mixed
Tags
throws
ArgumentException

rewind()

Iterator implementation

public rewind() : void

save()

public final save([mixed $ignoreEvents = false ]) : mixed
Parameters
$ignoreEvents : mixed = false

sysOnObjectPrimarySet()

Callback for object event when it gets primary

public sysOnObjectPrimarySet(mixed $object) : mixed
Parameters
$object : mixed

sysRemove()

public sysRemove(mixed $srPrimary) : mixed
Parameters
$srPrimary : mixed

valid()

Iterator implementation

public valid() : bool
Return values
bool

wakeUp()

Constructs set of existing objects from pre-selected data, including references and relations.

public final static wakeUp(mixed $rows) : array<string|int, mixed>|static
Parameters
$rows : mixed
Tags
throws
ArgumentException
throws
SystemException
Return values
array<string|int, mixed>|static

        
On this page

Search results