public function prepare() { if (!$this->query) { $this->query = $this->selectBuilder->build(); } try { $this->sth = $this->pdo->prepare($this->query); } catch (\PDOException $e) { throw new QueryException($this->query, null, $e); } if (!$this->sth) { throw new QueryException($this->query); } return $this; }
public function testOrder() { $this->selectBuilder->order('id DESC'); $this->assertEquals('SELECT * FROM test ORDER BY id DESC', $this->selectBuilder->build()); }