\Colibri\CollectionsIReadonlyCollection

Интерфейс для именованных массивов

Summary

Methods
Constants
Exists()
Contains()
Key()
Item()
ItemAt()
IndexOf()
ToString()
ToArray()
FromString()
Each()
Map()
Count()
First()
Last()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

Exists()

Exists(string  $key) : boolean

Проверка существования ключа в массиве

Parameters

string $key

Returns

boolean

Contains()

Contains(mixed  $item) 

Проверяет содержит ли коллекция значение

Parameters

mixed $item
  • значение для проверки

Key()

Key(integer  $index) : string

Вернуть ключ по индексу

Parameters

integer $index

Returns

string

Item()

Item(string  $key) : mixed

Вернуть значение по ключу

Parameters

string $key

Returns

mixed

ItemAt()

ItemAt(integer  $index) : mixed

Вернуть значение по индексу

Parameters

integer $index

Returns

mixed

IndexOf()

IndexOf(mixed  $item) 

Находит значение и возвращает индекс

Parameters

mixed $item
  • значение для поиска

ToString()

ToString(array<mixed,string>  $splitters = null,   $mapFunction = null) : string

В строку, с соединителями

Parameters

array<mixed,string> $splitters
$mapFunction

Returns

string

ToArray()

ToArray() : array

вернуть данные в виде обычного массива

Returns

array

FromString()

FromString(string  $string, array<mixed,string>  $splitters = null) : \Colibri\Collections\Collection

Парсит строку и сохраняет в коллекцию

Parameters

string $string
array<mixed,string> $splitters

Returns

\Colibri\Collections\Collection

Each()

Each(  $mapFunction) : void

Обход всей коллекции

Parameters

$mapFunction

Map()

Map(  $mapFunction) : \Colibri\Collections\IReadonlyCollection

Обход всей коллекции с изменением данных

Parameters

$mapFunction

Returns

\Colibri\Collections\IReadonlyCollection

Count()

Count() : void

Количество значений в коллекции

First()

First() : mixed

Возвращает первое значение

Returns

mixed

Last()

Last() : mixed

Возвращает последнее значение

Returns

mixed