コード例 #1
0
ファイル: ResultIterator.php プロジェクト: smasty/neevo
 /**
  * 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
ファイル: ResultTest.php プロジェクト: smasty/neevo
 public function testSeekOverflow()
 {
     $this->setExpectedException('Neevo\\NeevoException', 'Cannot seek to offset');
     $this->result->seek(5);
 }