lithium\data\Collection::rewind PHP 메소드

rewind() 공개 메소드

Rewinds the collection to the beginning.
public rewind ( )
    public function rewind()
    {
        $this->_started = true;
        reset($this->_data);
        $this->_valid = !empty($this->_data) || $this->_populate() !== null;
        return current($this->_data);
    }

Usage Example

예제 #1
0
 /**
  * Rewinds the collection of sub-`Document`s to the beginning and returns the first one found.
  *
  * @return object Returns the first `Document` object instance in the collection.
  */
 public function rewind()
 {
     $data = parent::rewind();
     $key = key($this->_data);
     return $this->offsetGet($key);
 }
All Usage Examples Of lithium\data\Collection::rewind