Exemplo n.º 1
0
 /**
  * @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;
     });
 }
Exemplo n.º 2
0
 /**
  * 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);
 }
Exemplo n.º 3
0
 /**
  * @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();
 }