コード例 #1
0
ファイル: DashboardResource.php プロジェクト: zource/zource
 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);
 }
コード例 #2
0
ファイル: Dashboard.php プロジェクト: zource/zource
 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');
 }