PHP Трейт yii\base\ArrayAccessTrait

Note that ArrayAccessTrait requires the class using it contain a property named data which should be an array. The data will be exposed by ArrayAccessTrait to support accessing the class object like an array.
С версии: 2.0
Автор: Qiang Xue ([email protected])
Показать файл Открыть проект

Открытые методы

Метод Описание
count ( ) : integer Returns the number of data items.
getIterator ( ) : ArrayIterator Returns an iterator for traversing the data.
offsetExists ( mixed $offset ) : boolean This method is required by the interface [[\ArrayAccess]].
offsetGet ( integer $offset ) : mixed This method is required by the interface [[\ArrayAccess]].
offsetSet ( integer $offset, mixed $item ) This method is required by the interface [[\ArrayAccess]].
offsetUnset ( mixed $offset ) This method is required by the interface [[\ArrayAccess]].

Описание методов

count() публичный Метод

This method is required by Countable interface.
public count ( ) : integer
Результат integer number of data elements.

getIterator() публичный Метод

This method is required by the SPL interface [[\IteratorAggregate]]. It will be implicitly called when you use foreach to traverse the collection.
public getIterator ( ) : ArrayIterator
Результат ArrayIterator an iterator for traversing the cookies in the collection.

offsetExists() публичный Метод

This method is required by the interface [[\ArrayAccess]].
public offsetExists ( mixed $offset ) : boolean
$offset mixed the offset to check on
Результат boolean

offsetGet() публичный Метод

This method is required by the interface [[\ArrayAccess]].
public offsetGet ( integer $offset ) : mixed
$offset integer the offset to retrieve element.
Результат mixed the element at the offset, null if no element is found at the offset

offsetSet() публичный Метод

This method is required by the interface [[\ArrayAccess]].
public offsetSet ( integer $offset, mixed $item )
$offset integer the offset to set element
$item mixed the element value

offsetUnset() публичный Метод

This method is required by the interface [[\ArrayAccess]].
public offsetUnset ( mixed $offset )
$offset mixed the offset to unset element