public function getById($id) { $data = $this->db->fetchRow("SELECT * FROM sites WHERE id = ?", $id); if (!$data["id"]) { throw new \Exception("there is no site for the requested id"); } $this->assignVariablesToModel($data); }