\Colibri\WebRequestCollection

Коллекция данных из запроса Readonly

Внимание! В целях избавления от проблемы XSS все данные слешируются посредством функции addslashes

Summary

Methods
Properties
Constants
__construct()
Exists()
Contains()
IndexOf()
Key()
Item()
ItemAt()
getIterator()
Each()
Map()
ToString()
FromString()
ToArray()
Count()
First()
Last()
__get()
offsetSet()
offsetExists()
offsetUnset()
offsetGet()
No public properties found
No constants found
No protected methods found
$data
N/A
_stripSlashes()
No private properties found
N/A

Properties

$data

$data : mixed

Данные коллекции

Type

mixed

Methods

__construct()

__construct(array  $data = array(), mixed  $mq = null) 

Конструктор

Parameters

array $data
mixed $mq

Exists()

Exists(string  $key) : boolean

Проверяет наличие ключа

Parameters

string $key
  • ключ для проверки

Returns

boolean

Contains()

Contains(mixed  $item) 

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

Parameters

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

IndexOf()

IndexOf(mixed  $item) 

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

Parameters

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

Key()

Key(mixed  $index) : string

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

Parameters

mixed $index

Returns

string

Item()

Item(mixed  $key) : mixed

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

Parameters

mixed $key

Returns

mixed

ItemAt()

ItemAt(mixed  $index) : mixed

Возвращает знаение по индексу

Parameters

mixed $index

Returns

mixed

getIterator()

getIterator() 

Возвращает итератор

Each()

Each(  $mapFunction) : void

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

Parameters

$mapFunction

Map()

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

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

Parameters

$mapFunction

Returns

\Colibri\Collections\ReadonlyCollection

ToString()

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

Превращает в строку

Parameters

array<mixed,string> $splitters
$mapFunction

Returns

string

FromString()

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

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

Parameters

string $string
array<mixed,string> $splitters

Returns

\Colibri\Collections\Collection

ToArray()

ToArray() : array

Возвращает данные в виде массива

Returns

array

Count()

Count() : void

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

First()

First() : mixed

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

Returns

mixed

Last()

Last() : mixed

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

Returns

mixed

__get()

__get(string  $property) : mixed

Магический метод

Parameters

string $property

свойство

Returns

mixed

offsetSet()

offsetSet(string  $offset, mixed  $value) : void

Устанавливает значение по индексу

Parameters

string $offset
mixed $value

offsetExists()

offsetExists(mixed  $offset) : boolean

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

Parameters

mixed $offset

Returns

boolean

offsetUnset()

offsetUnset(mixed  $offset) : void

Удаляет значение по индексу

Parameters

mixed $offset

offsetGet()

offsetGet(mixed  $offset) : mixed

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

Parameters

mixed $offset

Returns

mixed

_stripSlashes()

_stripSlashes(  $obj) : string

Чистит или добавляет слэши в значения

Parameters

$obj

Returns

string —

| string[]