/**
  * Returns the current result
  *
  * @returns xfDocumentHit
  */
 public function current()
 {
     $hit = $this->iterator->current();
     // this response is pluggable, we must do error checking
     if (!$hit instanceof xfDocumentHit) {
         throw new xfResultException('Iterator for engine must return instances of xfDocumentHit, ' . gettype($hit) . ' given');
     }
     $service = $this->registry->getService($hit->getServiceName());
     $hit->setRetorts($service->getRetorts());
     return $hit;
 }
Пример #2
0
 protected function readSectionSize(SeekableIterator $it)
 {
     $it->seek($this->start_line);
     if (!$it->valid()) {
         throw new phpMorphy_Mrd_Exception("Can`t read section size, iterator not valid");
     }
     $size = trim($it->current());
     if (!preg_match('~^[0-9]+$~', $size)) {
         throw new phpMorphy_Mrd_Exception("Invalid section size: {$size}");
     }
     return (int) $size;
 }