Exemplo n.º 1
0
 /**
  * Implentation of the Iterator SPL class for Next(), 
  * prepares the next record in line to be read and return by Current() and Key()
  * 
  * @access public
  */
 public function next()
 {
     $valid = false;
     do {
         $this->datasource->next();
     } while ($this->valid() && $this->shouldKeep($this->current(), $this->key()) == false);
 }
 /**
  * Implentation of the Iterator SPL class for Next(), 
  * prepares the next record in line to be read and return by Current() and Key()
  * 
  * @access public
  */
 public function next()
 {
     //Move to the next element
     $this->datasource->next();
     //Process the transformers
     if ($this->valid()) {
         $this->transformedData = $this->transform($this->datasource->current(), $this->datasource->key());
     }
 }
Exemplo n.º 3
0
 public static function findMinMax(\Traversable $it, callback $extractor = null)
 {
     if ($extractor === null) {
         $extractor = function ($value) {
             return $value;
         };
     }
     $min = $max = $extractor($it->current());
     $it->next();
     $value = $extractor($it->current());
     while ($it->valid()) {
         if ($value > $max) {
             $max = $value;
         } elseif ($value < $min) {
             $min = $value;
         }
         $it->next();
         $value = $it->current();
     }
     return array($min, $max);
 }
Exemplo n.º 4
0
 /**
  * Move forward to next element.
  *
  * @return  void
  */
 public function next()
 {
     return $this->_iterator->next();
 }
Exemplo n.º 5
0
 /**
  * Filter out duplicate items by advancing to the next ones
  */
 protected function filterViaNext()
 {
     while ($this->valid()) {
         $rel = $this->iter->current();
         // path relative to given directory
         $path = $this->params['dir'] . "/{$rel}";
         // full storage path
         if ($this->backend->isSingleShardPathInternal($path)) {
             break;
             // path is only on one shard; no issue with duplicates
         } elseif (isset($this->multiShardPaths[$rel])) {
             // Don't keep listing paths that are on multiple shards
             $this->iter instanceof Iterator ? $this->iter->next() : next($this->iter);
         } else {
             $this->multiShardPaths[$rel] = 1;
             break;
         }
     }
 }
Exemplo n.º 6
0
 /**
  * Increments the iterator to the next value
  *
  * @return NULL
  */
 function next()
 {
     if (isset($this->offset)) {
         $this->inner->next();
     }
 }
Exemplo n.º 7
0
 /**
  * Move forward to next element.
  *
  * @return  void
  */
 public function next()
 {
     $this->_current = null;
     return $this->_iterator->next();
 }
Exemplo n.º 8
0
 /**
  * {@inheritdoc}
  * 
  * @throws tjsd\collections\exceptions\EndOfIteratorException when trying to move internal pointer of iterator that reaches its end
  *
  * @return void
  */
 public function next()
 {
     $this->iterator->next();
 }
Exemplo n.º 9
0
 public function next()
 {
     $this->input->next();
 }