/** * @param Request $request * @param integer $movement * * @return RedirectResponse */ protected function move(Request $request, $movement) { $resource = $this->findOr404($request); $this->domainManager->move($resource, $movement); if ($this->config->isApiRequest()) { if ($resource instanceof ResourceEvent) { throw new HttpException($resource->getErrorCode(), $resource->getMessage()); } return $this->handleView($this->view($resource, 204)); } return $this->redirectHandler->redirectToIndex(); }
/** * @param Request $request * @param boolean $enabled * * @return RedirectResponse|Response */ protected function toggle(Request $request, $enabled) { $this->isGrantedOr403('update'); $resource = $this->findOr404($request); $resource->setEnabled($enabled); $this->domainManager->update($resource, $enabled ? 'enable' : 'disable'); if ($this->config->isApiRequest()) { if ($resource instanceof ResourceEvent) { throw new HttpException($resource->getErrorCode(), $resource->getMessage()); } return $this->handleView($this->view($resource, 204)); } return $this->redirectHandler->redirectToIndex(); }
/** * @param Request $request * @param integer $movement * * @return RedirectResponse */ protected function move(Request $request, $movement) { $resource = $this->findOr404($request); $this->domainManager->move($resource, $movement); return $this->redirectHandler->redirectToIndex(); }
/** * @{inheritdoc} */ public function __construct(ObjectManager $manager, EventDispatcherInterface $eventDispatcher, FlashHelper $flashHelper, Configuration $config, $templating) { parent::__construct($manager, $eventDispatcher, $flashHelper, $config); $this->templating = $templating; }