yii\web\SessionIterator - Yii2 类参考手册

Class yii\web\SessionIterator

Inheritanceyii\web\SessionIterator
ImplementsIterator
Available since version2.0

SessionIterator implements an iterator for traversing session variables managed by yii\web\Session.

Public Methods

隐藏继承的方法 Hide inherited methods

方法 Method简介 Description定义在 Defined By
__construct() Constructor. yii\web\SessionIterator
current() Returns the current array element. yii\web\SessionIterator
key() Returns the key of the current array element. yii\web\SessionIterator
next() Moves the internal pointer to the next array element. yii\web\SessionIterator
rewind() Rewinds internal array pointer. yii\web\SessionIterator
valid() Returns whether there is an element at current position. yii\web\SessionIterator

方法详情 Method Details

__construct() public method

Constructor.

public void __construct ( )
current() public method

Returns the current array element.

This method is required by the interface Iterator.

public mixed current ( )
return mixed

The current array element

key() public method

Returns the key of the current array element.

This method is required by the interface Iterator.

public mixed key ( )
return mixed

The key of the current array element

next() public method

Moves the internal pointer to the next array element.

This method is required by the interface Iterator.

public void next ( )
rewind() public method

Rewinds internal array pointer.

This method is required by the interface Iterator.

public void rewind ( )
valid() public method

Returns whether there is an element at current position.

This method is required by the interface Iterator.

public boolean valid ( )