本文整理匯總了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']);
}
示例2: current
function current()
{
$value = parent::current();
$fn = $this->callback;
$fn($value);
return $value;
}
示例3: current
/**
* returns the current element
*
* @return mixed
*/
public function current()
{
$consumeValue = $this->valueConsumer;
$current = parent::current();
$consumeValue($current);
return $current;
}
示例4: current
public function current()
{
$row = parent::current();
$keys = array_keys($row);
$column = $this->_column ?: array_shift($keys);
return $row[$column];
}
示例5: current
public function current()
{
$consumer = $this->consumer;
$current = parent::current();
$consumer($current);
return $current;
}
示例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;
}
示例7: current
public function current()
{
$value = parent::current();
foreach ($this->transformers as $fn) {
$value = $fn($value);
}
return $value;
}
示例8: next
public function next()
{
$this->chunk = array();
for ($i = 0; $i < $this->chunkSize && parent::valid(); $i++) {
$this->chunk[] = parent::current();
parent::next();
}
}
示例9: current
/**
* @inheritDoc
*/
public function current()
{
if (empty($this->_headers)) {
$this->_headers = parent::current();
parent::next();
}
return array_combine($this->_headers, parent::current());
}
示例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;
}
示例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;
}
示例12: current
public function current()
{
$value = parent::current();
foreach ($this->transformers as $fn) {
$value = call_user_func($fn, $value);
}
return $value;
}
示例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;
}
示例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);
}
示例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;
}