/** * @dataProvider provideCollection */ public function testCurrent(Collection $coll, array $elements) { $this->assertSame(current($elements), $coll->current()); next($elements); $coll->next(); $this->assertSame(current($elements), $coll->current()); }
/** * Generates the cells. * * @param TableView $view */ private function generateCells(TableView $view) { $sortDirs = [ColumnSort::ASC, ColumnSort::DESC]; $columns = $this->config->getColumns(); foreach ($columns as &$columnOptions) { $key = $columnOptions['full_name'] . '_sort'; $sortDir = $this->requestHelper->getVar($key, ColumnSort::NONE); $columnOptions['sorted'] = in_array($sortDir, $sortDirs); } unset($columnOptions); $this->data->first(); while ($this->data->current()) { $row = new Row($this->getCurrentRowData('id')); // TODO getCurrentRowKey() ? foreach ($columns as $columnOptions) { $cell = new Cell(); $type = $this->factory->getColumnType($columnOptions['type']); $type->buildViewCell($cell, $this, $columnOptions); $row->cells[] = $cell; } $view->rows[] = $row; $this->data->next(); } }
/** * Moves the internal iterator position to the next element. */ public function next() { return $this->coll->next(); }
/** * {@inheritDoc} */ public function next() { $this->initialize(); return $this->collection->next(); }
/** * @param Collection $units * * @return OrderItemUnitInterface */ private function getNextUnit(Collection $units) { $unit = $units->current(); if (null === $unit) { throw new \InvalidArgumentException('The number of tax items is greater than number of units.'); } $units->next(); return $unit; }
/** * Moves the internal iterator position to the next element and returns this element. * * @return mixed */ function next() { $this->initialize(); $next = $this->collection->next(); return $next->getTerm(); }
/** * {@inheritdoc} */ public function next() { return $this->inner->next(); }
public function next() { $this->_data->next(); }