本文整理汇总了PHP中Doctrine\Common\Collections\Collection::next方法的典型用法代码示例。如果您正苦于以下问题:PHP Collection::next方法的具体用法?PHP Collection::next怎么用?PHP Collection::next使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\Common\Collections\Collection
的用法示例。
在下文中一共展示了Collection::next方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCurrent
/**
* @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());
}
示例2: generateCells
/**
* 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();
}
}
示例3: next
/**
* Moves the internal iterator position to the next element.
*/
public function next()
{
return $this->coll->next();
}
示例4: next
/**
* {@inheritDoc}
*/
public function next()
{
$this->initialize();
return $this->collection->next();
}
示例5: getNextUnit
/**
* @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;
}
示例6: next
/**
* 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();
}
示例7: next
/**
* {@inheritdoc}
*/
public function next()
{
return $this->inner->next();
}
示例8: next
public function next()
{
$this->_data->next();
}