getUser()->isAdmin()) { throw new Forbidden(); } } public function actionIndex($params, $data, $request) { return false; } public function actionRead($params, $data, $request) { $entity = $this->getEntityManager()->getEntity('Integration', $params['id']); return $entity->toArray(); } public function actionUpdate($params, $data, $request) { return $this->actionPatch($params, $data, $request); } public function actionPatch($params, $data, $request) { if (!$request->isPut() && !$request->isPatch()) { throw new BadRequest(); } $entity = $this->getEntityManager()->getEntity('Integration', $params['id']); $entity->set($data); $this->getEntityManager()->saveEntity($entity); return $entity->toArray(); } }