Beispiel #1
0
 /**
  * Builds the SQL statement from the instance.
  * @return string The SQL statement
  * @internal
  */
 public function parse()
 {
     if ($this->hasCircularReferences($this)) {
         throw new RuntimeException('Circular reference found in the query tree, cannot parse the query.');
     }
     $this->connection->connect();
     $parser = $this->connection->getParser();
     $instance = new $parser($this);
     return $instance->parse();
 }
Beispiel #2
0
 /** @return DummyParserDriver */
 private function parser(BaseStatement $stmt)
 {
     $instance = $this->connection->getParser();
     return new $instance($stmt);
 }
Beispiel #3
0
 public function testSetCustomParser()
 {
     $connection = new Connection(array('driver' => 'DummyParser'));
     $this->assertEquals($connection->getParser(), 'Neevo\\Drivers\\DummyParserDriver');
 }