/** * Begins preparing a query * * @param string $query * @throws DBQueryException */ public function __construct($query) { $this->conn = Registry::getDatabase(); $this->query = $query; try { $this->stmt = $this->conn->prepare($this->query); } catch (PDOException $e) { // Fatal query exception throw new DBQueryException($this->query, $e); } }