Esempio n. 1
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);
 }
Esempio n. 2
0
 public function loadAction()
 {
     $gadget = $this->gadgetTaskService->find($this->params()->fromQuery('id'));
     if (!$gadget) {
         return $this->notFoundAction();
     }
     $viewModel = new ViewModel(['gadget' => $gadget]);
     $viewModel->setTerminal(true);
     return $viewModel;
 }