public function getById($id = null) { if ($id != null) { $this->model->setId($id); } $data = $this->db->fetchRow("SELECT * FROM " . self::TABLE_NAME_GROUPS . " WHERE id = ?", $this->model->getId()); $this->assignVariablesToModel($data); }