Package | system.web |
---|---|
Inheritance | class CHttpSessionIterator |
Implements | Iterator, Traversable |
Since | 1.0 |
Source Code | framework/web/CHttpSessionIterator.php |
Method | Description | Defined By |
---|---|---|
__construct() | Constructor. | CHttpSessionIterator |
current() | Returns the current array element. | CHttpSessionIterator |
key() | Returns the key of the current array element. | CHttpSessionIterator |
next() | Moves the internal pointer to the next array element. | CHttpSessionIterator |
rewind() | Rewinds internal array pointer. | CHttpSessionIterator |
valid() | Returns whether there is an element at current position. | CHttpSessionIterator |
public void __construct()
|
public function __construct()
{
$this->_keys=array_keys($_SESSION);
}
Constructor.
public mixed current()
| ||
{return} | mixed | the current array element |
public function current()
{
return isset($_SESSION[$this->_key])?$_SESSION[$this->_key]:null;
}
Returns the current array element. This method is required by the interface Iterator.
public mixed key()
| ||
{return} | mixed | the key of the current array element |
public function key()
{
return $this->_key;
}
Returns the key of the current array element. This method is required by the interface Iterator.
public void next()
|
public function next()
{
do
{
$this->_key=next($this->_keys);
}
while(!isset($_SESSION[$this->_key]) && $this->_key!==false);
}
Moves the internal pointer to the next array element. This method is required by the interface Iterator.
public void rewind()
|
public function rewind()
{
$this->_key=reset($this->_keys);
}
Rewinds internal array pointer. This method is required by the interface Iterator.
public boolean valid()
| ||
{return} | boolean |
public function valid()
{
return $this->_key!==false;
}
Returns whether there is an element at current position. This method is required by the interface Iterator.
Signup or Login in order to comment.