Example #1
0
 /**
  * Implementation of SeekableIterator.
  * @param int $offset
  * @throws OutOfRangeException|DriverException
  */
 public function seek($offset)
 {
     try {
         $this->result->seek($offset);
     } catch (DriverException $e) {
         throw $e;
     } catch (NeevoException $e) {
         throw new OutOfRangeException("Cannot seek to offset {$offset}.", null, $e);
     }
     $this->row = $this->result->fetch();
     $this->pointer = $offset;
 }
Example #2
0
 public function testSeek()
 {
     $this->result->seek(2);
     $this->assertEquals($this->result->getConnection()->getDriver()->getRow(2), $this->result->fetch()->toArray());
 }