示例#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;
 }
示例#2
0
 public function testSeekOverflow()
 {
     $this->setExpectedException('Neevo\\NeevoException', 'Cannot seek to offset');
     $this->result->seek(5);
 }