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); }