當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Collection::next方法代碼示例

本文整理匯總了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());
 }
開發者ID:malarzm,項目名稱:collections,代碼行數:10,代碼來源:BaseTest.php

示例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();
     }
 }
開發者ID:ekyna,項目名稱:table,代碼行數:29,代碼來源:Table.php

示例3: next

 /**
  * Moves the internal iterator position to the next element.
  */
 public function next()
 {
     return $this->coll->next();
 }
開發者ID:dracony,項目名稱:forked-php-orm-benchmark,代碼行數:7,代碼來源:PersistentCollection.php

示例4: next

 /**
  * {@inheritDoc}
  */
 public function next()
 {
     $this->initialize();
     return $this->collection->next();
 }
開發者ID:BozzaCoon,項目名稱:SPHERE-Framework,代碼行數:8,代碼來源:AbstractLazyCollection.php

示例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;
 }
開發者ID:stevedien,項目名稱:Sylius,代碼行數:14,代碼來源:OrderItemsTaxesByZoneApplicator.php

示例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();
 }
開發者ID:activelamp,項目名稱:taxonomy,代碼行數:11,代碼來源:PluralVocabularyField.php

示例7: next

 /**
  * {@inheritdoc}
  */
 public function next()
 {
     return $this->inner->next();
 }
開發者ID:peterkrejci,項目名稱:music-collection,代碼行數:7,代碼來源:ReadOnlyCollectionWrapper.php

示例8: next

 public function next()
 {
     $this->_data->next();
 }
開發者ID:niyazbekovbakyt,項目名稱:estimations,代碼行數:4,代碼來源:RecursiveTaskIterator.php


注:本文中的Doctrine\Common\Collections\Collection::next方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。