getContainer()->getPermissionsService()->currentUserCanWrite(Entities::SERVICES)) { throw new AccessDeniedException('You are not allowed to update service.'); } $result = new CommandResult(); $this->checkMandatoryFields($command); /** @var ServiceRepository $serviceRepository */ $serviceRepository = $this->container->get('domain.bookable.service.repository'); $serviceRepository->updateStatusById( $command->getArg('id'), $command->getField('status') ); $result->setResult(CommandResult::RESULT_SUCCESS); $result->setMessage('Successfully updated user'); $result->setData(true); return $result; } }