public function update($id, $data) { /** @var \ZourceApplication\Entity\Dashboard $dashboard */ $dashboard = $this->dashboardTaskService->find($id); if (!$dashboard) { return new ApiProblem(ApiProblemResponse::STATUS_CODE_404, 'Entity not found.'); } $this->dashboardTaskService->updateFromArray($dashboard, $data); return new DashboardEntity($dashboard); }
public function deleteAction() { /** @var DashboardEntity $dashboard */ $dashboard = $this->dashboardTaskService->find($this->params('id')); if (!$dashboard) { return $this->notFoundAction(); } $this->dashboardTaskService->remove($dashboard); return $this->redirect()->toRoute('dashboard/manage'); }