/** * @param string $value * * @return bool */ protected function checkParentIdExists($value) { if (empty($value)) { return true; } return $this->menuItemRepository->menuItemExists($value); }
/** * @param int $id * @param string $action * * @return \Symfony\Component\HttpFoundation\RedirectResponse * @throws \ACP3\Core\Controller\Exception\ResultNotExistsException */ public function execute($id, $action) { if ($this->menuItemRepository->menuItemExists($id) === true) { $this->sortOperation->execute($id, $action); $this->menusCache->saveMenusCache(); Core\Cache\Purge::doPurge($this->appPath->getCacheDir() . 'http'); return $this->redirect()->temporary('acp/menus'); } throw new Core\Controller\Exception\ResultNotExistsException(); }