public function rewind() { parent::rewind(); if ($this->valid()) { $this->currentResult = $this->handleItem($this->current()); } }
public function rewind() { if ($this->isfirstrun) { $this->firstrun(); $this->isfirstrun = FALSE; } parent::rewind(); }
public function rewind() { parent::rewind(); $this->found = false; if (ComparisonHelper::isEquals($this->current(), $this->to)) { $this->found = true; } }
/** * Rewind iteration */ public function rewind() { parent::rewind(); $this->count = 0; $this->window = []; if (parent::valid()) { $this->advanceWindow(); } }
/** * @param array|\Traversable $iterable * * @return \Iterator */ private function createIteratorFromIterable($iterable) { if (is_array($iterable)) { return new \ArrayIterator($iterable); } $iterator = new \IteratorIterator($iterable); $iterator->rewind(); return $iterator; }
/** * Restarts the iterator * * @return NULL */ public function rewind() { if (!$this->rewound) { $this->rewound = TRUE; return parent::rewind(); } else { throw new PHPUnit_Framework_ExpectationFailedException("Iterator has already been rewound"); } }
public function rewind() { parent::rewind(); $found = false; while ($this->valid()) { if (ComparisonHelper::isEquals($this->current(), $this->from)) { $found = true; } $this->next(); if ($found) { break; } } }
/** * Get next bunch of validated rows. * * @return array|null */ public function getNextBunch() { if (null === $this->_iterator) { $this->_iterator = $this->getIterator(); $this->_iterator->rewind(); } if ($this->_iterator->valid()) { $dataRow = $this->_iterator->current(); $dataRow = Mage::helper('core')->jsonDecode($dataRow[0]); $this->_iterator->next(); } else { $this->_iterator = null; $dataRow = null; } return $dataRow; }
/** * Get next bunch of validatetd rows. * * @return array|null */ public function getNextBunch() { if (null === $this->_iterator) { $this->_iterator = $this->getIterator(); $this->_iterator->rewind(); } if ($this->_iterator->valid()) { $dataRow = $this->_iterator->current(); $dataRow = unserialize($dataRow[0]); $this->_iterator->next(); } else { $this->_iterator = null; $dataRow = null; } return $dataRow; }
public function rewind() { parent::rewind(); $this->key = 0; }
public function rewind() { $this->index = 0; parent::rewind(); }
public function rewind() { parent::rewind(); $this->it2->rewind(); }
public function rewind() { parent::rewind(); //need to loop until first match $this->movetonextmatch(); }
public function rewind() { parent::rewind(); $this->lineNumber = 1; $this->columnNumber = 1; }
function rewind() { parent::rewind(); $this->fetch(); }
public function rewind() { parent::rewind(); // Skip head. $this->next(); }
public function rewind() { $this->stack = array($this->rootNode); parent::rewind(); $this->build(); }
function rewind() { $this->index = 0; return parent::rewind(); }
/** * Resets the iterator (as required by the Iterator interface). * * @return bool true, if the iterator rewinds successfully otherwise false */ public function rewind() { return $this->iterator->rewind(); }
private function initTokenizer() { $tokens = new \IteratorIterator($this->tokenizer); $tokens->rewind(); $this->tokenIterator = $tokens; }
public function rewind() { $this->_progress->update(0); return parent::rewind(); }
public function rewind() { parent::rewind(); $this->key = $this->start; }
/** * Rewinds iterator. */ public function rewind() { $this->peek = null; $this->data->rewind(); }
/** * ( excerpt from http://php.net/manual/en/cachingiterator.rewind.php ) * * * @return mixed No value is returned. */ function rewind() { if ($this->fullCacheIterator) { $this->fullCacheIterator = new ArrayIterator(); } parent::rewind(); $this->moveInnerIteratorNext(); }
/** * Restarts the iterator * * @return NULL */ public function rewind() { $this->dumpStart(__FUNCTION__); $result = parent::rewind(); $this->dumpEnd(__FUNCTION__, $result); return $result; }
public function find($collection, $filters, $fields = null, $sort = null, $start = 0, $limit = 25, $debug = false) { $collection = $this->db->selectCollection($collection); if (isset($filters['id'])) { $filters['_id'] = new \MongoDB\BSON\ObjectID($filters['id']); unset($filters['id']); } $query_filters = []; if ($filters != null) { $query_filters = ['$and' => self::buildFilter($filters)]; } $count = $collection->count($query_filters); if ($count > 0) { $results = []; $options = ['limit' => (int) $limit, 'skip' => (int) $start, 'typeMap' => ['root' => 'array', 'document' => 'array']]; if ($fields !== null) { $projection = []; foreach ($fields as $field) { if ($field == 'id') { $field = '_id'; } $projection[$field] = true; } $options['projection'] = $projection; } if ($sort !== null) { foreach ($sort as $sort_key => $sort_dir) { $sort[$sort_key] = $sort_dir == 'desc' ? -1 : 1; if ($sort_key == 'id') { $sort['_id'] = $sort[$sort_key]; unset($sort['id']); } } $options['sort'] = $sort; } $cursor = $collection->find($query_filters, $options); $iterator = new \IteratorIterator($cursor); $iterator->rewind(); while ($doc = $iterator->current()) { if (isset($doc['_id'])) { $doc['id'] = (string) $doc['_id']; unset($doc['_id']); } $results[] = $doc; $iterator->next(); } return ['total' => $count, 'data' => $results]; } return ['total' => 0, 'data' => null]; }
public function rewind() { parent::rewind(); $this->next(); }
<?php $I = new IteratorIterator(new ArrayIterator(array(1, 2, 3))); $I->rewind(); var_dump($I->current()); $I->next(); var_dump($I->current()); $I->next(); var_dump($I->current()); $I->next(); var_dump($I->current());
/** * {@inheritdoc} */ public function rewind() { $this->neighbour->rewind(); parent::rewind(); }
private function initByteIterator() { $bytes = new \IteratorIterator($this->bytestream); $bytes->rewind(); $this->byteIterator = $bytes; }