"Fossies" - the Fresh Open Source Software Archive

Member "yii-docs-1.1.24.a5ab20/api/CListIterator.html" (7 Jun 2021, 12063 Bytes) of package /linux/www/yii-docs-1.1.24.a5ab20.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the project site itself.

Yii Framework v1.1.24 Class Reference

CListIterator

Package system.collections
Inheritance class CListIterator
Implements Iterator, Traversable
Since 1.0
Source Code framework/collections/CListIterator.php
CListIterator implements an iterator for CList.

It allows CList to return a new iterator for traversing the items in the list.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Constructor. CListIterator
current() Returns the current array item. CListIterator
key() Returns the key of the current array item. CListIterator
next() Moves the internal pointer to the next array item. CListIterator
rewind() Rewinds internal array pointer. CListIterator
valid() Returns whether there is an item at current position. CListIterator

Method Details

__construct() method
public void __construct(array &$data)
$data array the data to be iterated through
Source Code: framework/collections/CListIterator.php#35 (show)
public function __construct(&$data)
{
    
$this->_d=&$data;
    
$this->_i=0;
}

Constructor.

current() method
public mixed current()
{return} mixed the current array item
Source Code: framework/collections/CListIterator.php#65 (show)
public function current()
{
    return 
$this->_d[$this->_i];
}

Returns the current array item. This method is required by the interface Iterator.

key() method
public integer key()
{return} integer the key of the current array item
Source Code: framework/collections/CListIterator.php#55 (show)
public function key()
{
    return 
$this->_i;
}

Returns the key of the current array item. This method is required by the interface Iterator.

next() method
public void next()
Source Code: framework/collections/CListIterator.php#74 (show)
public function next()
{
    
$this->_i++;
}

Moves the internal pointer to the next array item. This method is required by the interface Iterator.

rewind() method
public void rewind()
Source Code: framework/collections/CListIterator.php#45 (show)
public function rewind()
{
    
$this->_i=0;
}

Rewinds internal array pointer. This method is required by the interface Iterator.

valid() method
public boolean valid()
{return} boolean
Source Code: framework/collections/CListIterator.php#84 (show)
public function valid()
{
    return 
$this->_i<count($this->_d);
}

Returns whether there is an item at current position. This method is required by the interface Iterator.

© 2008-2013 by Yii Software LLC
All Rights Reserved.