/** * 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(); }
/** @return DummyParserDriver */ private function parser(BaseStatement $stmt) { $instance = $this->connection->getParser(); return new $instance($stmt); }
public function testSetCustomParser() { $connection = new Connection(array('driver' => 'DummyParser')); $this->assertEquals($connection->getParser(), 'Neevo\\Drivers\\DummyParserDriver'); }