public function getByName($id = null)
{
if ($id != null) {
$this->model->setName($id);
}
$data = $this->db->getById($this->model->getName());
if (isset($data["id"])) {
$this->assignVariablesToModel($data);
$this->model->setName($data["id"]);
} else {
throw new \Exception("Thumbnail with id: " . $this->model->getName() . " does not exist");
}
}