예제 #1
0
 public function update($id, $data)
 {
     $gadgetContainer = $this->gadgetTaskService->findContainer($id);
     if (!$gadgetContainer) {
         return new ApiProblem(ApiProblemResponse::STATUS_CODE_404, 'Entity not found.');
     }
     $this->gadgetTaskService->updateGadgetContainer($gadgetContainer, (array) $data);
     return new GadgetContainerEntity($gadgetContainer);
 }
예제 #2
0
파일: Gadget.php 프로젝트: zource/zource
 public function updateContainerAction()
 {
     $gadgetContainer = $this->gadgetTaskService->findContainer($this->params('id'));
     if (!$gadgetContainer) {
         return $this->notFoundAction();
     }
     $result = $this->gadgetTaskService->updateGadgetContainer($gadgetContainer, $this->getRequest()->getPost()->toArray());
     return new JsonModel($result);
 }
예제 #3
0
 public function update($id, $data)
 {
     /** @var \ZourceApplication\Entity\Gadget $gadget */
     $gadget = $this->gadgetTaskService->find($id);
     if (!$gadget) {
         return new ApiProblem(ApiProblemResponse::STATUS_CODE_404, 'Entity not found.');
     }
     $this->gadgetTaskService->updateFromArray($gadget, (array) $data);
     return $this->buildGadgetEntity($gadget);
 }
예제 #4
0
파일: Dashboard.php 프로젝트: zource/zource
 public function indexAction()
 {
     $account = $this->zourceAccount();
     $dashboard = $this->dashboardTaskService->getAccountDashboard($account);
     return new ViewModel(['dashboard' => $dashboard, 'gadgets' => $this->gadgetTaskService->getAvailableGadgets(), 'gadgetCategories' => $this->gadgetTaskService->getGadgetCategories()]);
 }