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); }
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); }
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); }
public function indexAction() { $account = $this->zourceAccount(); $dashboard = $this->dashboardTaskService->getAccountDashboard($account); return new ViewModel(['dashboard' => $dashboard, 'gadgets' => $this->gadgetTaskService->getAvailableGadgets(), 'gadgetCategories' => $this->gadgetTaskService->getGadgetCategories()]); }