Esempio n. 1
0
 /**
  * @return Item|mixed
  */
 function current()
 {
     $current = $this->_result->current();
     if (is_array($current)) {
         $current = (new Item($this->_collection))->setData($current);
     }
     return $this->_pipe->process($current);
 }
Esempio n. 2
0
 /**
  * Iterator: get current item
  *
  * @return array
  */
 public function current()
 {
     if ($this->buffer === null) {
         $this->buffer = -2;
         // implicitly disable buffering from here on
     } elseif (is_array($this->buffer) && isset($this->buffer[$this->position])) {
         return $this->buffer[$this->position];
     }
     $data = $this->dataSource->current();
     if (is_array($this->buffer)) {
         $this->buffer[$this->position] = $data;
     }
     return $data;
 }
Esempio n. 3
0
 /**
  * Create current SiteInfo
  *
  * @return  SiteInfo
  */
 protected function createCurrentSiteInfo()
 {
     while ($this->queryResult->valid()) {
         $data = $this->queryResult->current();
         $current = $this->createSiteInfo($data);
         $schema = $current->getSchema();
         if (!empty($this->queriedSchemas[$schema])) {
             $this->queryResult->next();
         } else {
             $this->queriedSchemas[$schema] = true;
             return $this->setSiteInfo($this->currentSiteInfo = $current);
         }
     }
     $this->currentSiteInfo = null;
     return null;
 }