/** * @param string $action * * @return mixed * @throws \ACP3\Core\Controller\Exception\ResultNotExistsException */ public function execute($action = '') { return $this->actionHelper->handleDeleteAction($action, function (array $items) { $result = $this->seoModel->delete($items); $this->seoCache->saveCache(); return $result; }); }
/** * Returns an uri alias by a given path * * @param string $path * @param bool $emptyOnNoResult * * @return string */ public function getUriAlias($path, $emptyOnNoResult = false) { if ($this->aliasesCache === []) { $this->aliasesCache = $this->seoCache->getCache(); } $path .= !preg_match('/\\/$/', $path) ? '/' : ''; return !empty($this->aliasesCache[$path]['alias']) ? $this->aliasesCache[$path]['alias'] : ($emptyOnNoResult === true ? '' : $path); }
/** * @param string $path * @param string $key * @param string $defaultValue * * @return string */ public function getSeoInformation($path, $key, $defaultValue = '') { // Lazy load the cache if ($this->aliasesCache === null) { $this->aliasesCache = $this->seoCache->getCache(); } $path .= !preg_match('/\\/$/', $path) ? '/' : ''; return !empty($this->aliasesCache[$path][$key]) ? $this->aliasesCache[$path][$key] : $defaultValue; }
public function execute() { $this->cache->saveCache(); }