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


PHP IteratorIterator::current方法代碼示例

本文整理匯總了PHP中IteratorIterator::current方法的典型用法代碼示例。如果您正苦於以下問題:PHP IteratorIterator::current方法的具體用法?PHP IteratorIterator::current怎麽用?PHP IteratorIterator::current使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在IteratorIterator的用法示例。


在下文中一共展示了IteratorIterator::current方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: next

 /**
  * Returns next entity.
  *
  * @return Entity|null
  */
 public function next()
 {
     if (null !== $this->peek) {
         $entity = $this->peek;
         $this->peek = null;
         return $entity;
     }
     $item = $this->data->current();
     if (null === $item) {
         return null;
     }
     $this->data->next();
     return new Entity($item, $this->accessor, $this->options['mapping'], $this->options['id_path']);
 }
開發者ID:jfsimon,項目名稱:datagrid,代碼行數:19,代碼來源:Collection.php

示例2: current

 function current()
 {
     $value = parent::current();
     $fn = $this->callback;
     $fn($value);
     return $value;
 }
開發者ID:Garcy111,項目名稱:Garcy-Framework-2,代碼行數:7,代碼來源:Iterator.php

示例3: current

 /**
  * returns the current element
  *
  * @return  mixed
  */
 public function current()
 {
     $consumeValue = $this->valueConsumer;
     $current = parent::current();
     $consumeValue($current);
     return $current;
 }
開發者ID:stubbles,項目名稱:stubbles-sequence,代碼行數:12,代碼來源:Peek.php

示例4: current

 public function current()
 {
     $row = parent::current();
     $keys = array_keys($row);
     $column = $this->_column ?: array_shift($keys);
     return $row[$column];
 }
開發者ID:lox,項目名稱:pheasant,代碼行數:7,代碼來源:ColumnIterator.php

示例5: current

 public function current()
 {
     $consumer = $this->consumer;
     $current = parent::current();
     $consumer($current);
     return $current;
 }
開發者ID:intrawarez,項目名稱:sabertooth,代碼行數:7,代碼來源:CallbackConsumerIterator.php

示例6: current

 /**
  * Returns the current value of the iterator
  *
  * @return Mixed Returns NULL if there is no current value
  */
 public function current()
 {
     $this->dumpStart(__FUNCTION__);
     $result = parent::current();
     $this->dumpEnd(__FUNCTION__, $result);
     return $result;
 }
開發者ID:Nycto,項目名稱:Round-Eights,代碼行數:12,代碼來源:Debug.php

示例7: current

 public function current()
 {
     $value = parent::current();
     foreach ($this->transformers as $fn) {
         $value = $fn($value);
     }
     return $value;
 }
開發者ID:mikevanwinkle,項目名稱:cli,代碼行數:8,代碼來源:Transform.php

示例8: next

 public function next()
 {
     $this->chunk = array();
     for ($i = 0; $i < $this->chunkSize && parent::valid(); $i++) {
         $this->chunk[] = parent::current();
         parent::next();
     }
 }
開發者ID:jorjoh,項目名稱:Varden,代碼行數:8,代碼來源:ChunkedIterator.php

示例9: current

 /**
  * @inheritDoc
  */
 public function current()
 {
     if (empty($this->_headers)) {
         $this->_headers = parent::current();
         parent::next();
     }
     return array_combine($this->_headers, parent::current());
 }
開發者ID:ExpandOnline,項目名稱:CakePHPUtil,代碼行數:11,代碼來源:CsvFileIterator.php

示例10: current

 /**
  * Return the current element
  * This method is required by the interface [[\Iterator]].
  * @return mixed current row
  */
 public function current()
 {
     $value = parent::current();
     if (!isset($value['file'])) {
         $value['file'] = $this->collection->createDownload(array_intersect_key($value, ['_id' => true, 'filename' => true, 'length' => true, 'chunkSize' => true]));
     }
     return $value;
 }
開發者ID:mootensai,項目名稱:yii2-mongodb,代碼行數:13,代碼來源:Cursor.php

示例11: current

 /**
  * for each configured field, if it's in the results, translate it
  *
  * @return array
  **/
 public function current()
 {
     $value = parent::current();
     foreach ($this->_settings['fields'] as $field) {
         $this->_update($value, $field);
     }
     return $value;
 }
開發者ID:nodesagency,項目名稱:Translations,代碼行數:13,代碼來源:TranslateInjector.php

示例12: current

 public function current()
 {
     $value = parent::current();
     foreach ($this->transformers as $fn) {
         $value = call_user_func($fn, $value);
     }
     return $value;
 }
開發者ID:Jaace,項目名稱:wp-cli,代碼行數:8,代碼來源:Transform.php

示例13: next

 public function next()
 {
     $this->chunk = array();
     for ($i = 0; $i < $this->size && parent::valid(); ++$i) {
         $this->chunk[] = parent::current();
         parent::next();
     }
     $this->chunk ? $this->key++ : null;
 }
開發者ID:arduanov,項目名稱:pipes,代碼行數:9,代碼來源:ChunkIterator.php

示例14: current

 public function current()
 {
     if (!$this->valid()) {
         return NULL;
     }
     $this->_args[0] = parent::current();
     $this->_args[1] = parent::key();
     return call_user_func_array($this->_callback, $this->_args);
 }
開發者ID:evilgeny,項目名稱:bob,代碼行數:9,代碼來源:MapIterator.class.php

示例15: current

 public function current()
 {
     $out = parent::current();
     if ($this->callback_fn) {
         $modified_out = call_user_func($this->callback_fn, $out);
         return $modified_out;
     }
     return $out;
 }
開發者ID:deweller,項目名稱:mongomodel,代碼行數:9,代碼來源:CallbackIterator.php


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