/** * Implentation of the Iterator SPL class for Rewind(), * prepares the whole datasource for an entirely new iterator operation * * @access public */ public function rewind() { $this->datasource->rewind(); //Process the transformers if ($this->valid()) { $this->transformedData = $this->transform($this->datasource->current(), $this->datasource->key()); } }
/** * Return the key of the current element. * * @return mixed */ public function key() { return $this->_iterator->key(); }
/** * Returns the key of the current offset * * @return Mixed */ function key() { return isset($this->offset) ? $this->inner->key() : NULL; }
/** * Implentation of the Iterator SPL class for Key(), * returns the current element's identification of the data source * Returns null if nothing found * * @access public * * @return mixed Value. */ public function key() { return $this->datasource->key(); }
public function key() { return $this->input->key(); }
/** * Example of applying a callback to capitalize the first letter. * * Note that you must return TRUE from the callback function to continue * iterating. This can be useful if you wish to stop iteration under * certain conditions. * * @param Iterator $it * @return bool */ function addDbPrefix(Traversable $it, $prefix = 'test') { echo $it[$it->key()] = $prefix . '_' . $it->current(); echo PHP_EOL; return true; }