Trait yii\base\ArrayAccessTrait

Implemented byyii\test\ActiveFixture, yii\test\ArrayFixture, yii\test\BaseActiveFixture
Available since version2.0
Source Code https://github.com/yiisoft/yii2/blob/master/framework/base/ArrayAccessTrait.php

ArrayAccessTrait provides the implementation for IteratorAggregate, ArrayAccess and Countable.

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.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$data array yii\base\ArrayAccessTrait

Property Details

$data public property
public array $data null

Method Details

count() public method

public void count ( )
getIterator() public method

public void getIterator ( )
offsetExists() public method

public void offsetExists ( $offset )
$offset
offsetGet() public method

public void offsetGet ( $offset )
$offset
offsetSet() public method

public void offsetSet ( $offset, $item )
$offset
$item
offsetUnset() public method

public void offsetUnset ( $offset )
$offset