protected function exec(Query $builder) { $this->stmt = $this->pdo->prepare($builder->getSql()); foreach ($builder->getBind() as $k => $v) { $this->stmt->bindParam($k, $v); } $this->stmt->execute(); }
/** * Checks if the correct SQL is returned by the query object. */ public function testGetSqlReturnsCorrectValue() { $this->assertEquals('SELECT * FROM user WHERE id = ?', $this->query->getSql()); }