public function getById($id = null)
{
if ($id != null) {
$this->model->setId($id);
}
$data = $this->db->getById($this->model->getId());
if (isset($data["id"])) {
$this->assignVariablesToModel($data);
} else {
throw new \Exception("Doc-type with id " . $this->model->getId() . " doesn't exist");
}
}