Documentation

Collection

Collection is handled by a separate class (specifically returned by the method Service\[link=13981986]Factory[/link]::getFieldsCollection()).

Class reproduces interfaces \Iterator, \ArrayAccess, \Countable.


Method Description Available from version
public function __construct(array $fields)
Constructor. $fields - array with Field objects.
public function toArray(): array
Converts collection into array, where key - field code, value - field description converted into an array.
public function hasField(string $fieldName): bool
Returns true, when collection has the field with code $fieldName.
public function getField(string $fieldName): ?Field
Returns field by its code $fieldName, if available.
public function getFieldNameList(): array
Returns array with field codes, included into the collection.
© «Bitrix24», 2001-2024