Returns true if there is already an alias of another path+pathParameters+locale.

@param       $alias
@param       $path
@param array $pathParameters
@param null  $locale

@return ContentInterface
427111
public function checkIsAliasExistsAlready($alias, $path, array $pathParameters = array(), $locale = null)
    {
        if ($alias === null) {
            return false;
        }
        $already = $this->findByAlias($alias);
        if ($already) {
            $seo = $this->createNewAlias($alias, $path, $pathParameters, $locale);
            if ($seo->getKeyword() == $already->getKeyword()) {
                return false;
            }

            return true;
        }

        return false;
    }
88808
protected function storeGlobalAlias(UrlAlias $alias)
    {
        $paths = $this->combinePaths($alias->pathData);

        foreach ($paths as $path) {
            $this->storeGlobalAliasPath(
                $alias->destination,
                $path,
                reset($alias->languageCodes),
                $alias->alwaysAvailable,
                $alias->forward
            );
        }

        return count($paths);
    }
314915
public function find($path, array $locales, $translationDirectory = null)
    {
        $finder = new Finder();
        $translationDirectory = $translationDirectory ?? $this->defaultTranslationFolder;

        $exploreDir = $path . '/' . $translationDirectory;

        if (is_dir($exploreDir)) {
            $finder->files()
                ->name(sprintf('/(.*(%s)\.(%s))/', implode('|', $locales), implode('|', $this->fileFormats)))
                ->in($exploreDir);

            return $finder;
        }

        throw new TranslationsNotFoundException('Directory `' . $exploreDir . '` does not exist, translations could not be found.');
    }
337979
public static function alias($path, $value = null)
    {
        // get path by alias
        if (\is_string($path) && !$value) {
            // don't use alias
            if ($path[0] !== '@') {
                return $path;
            }

            $sep = '/';
            $path = str_replace(['/', '\\'], $sep, $path);

            // only a alias. e.g. @project
            if (!strpos($path, $sep)) {
                return self::$aliases[$path] ?? $path;
            }

            // have other partial. e.g: @project/temp/logs
            $realPath = $path;
            list($alias, $other) = explode($sep, $path, 2);

            if (isset(self::$aliases[$alias])) {
                $realPath = self::$aliases[$alias] . $sep . $other;
            }

            return $realPath;
        }

        if ($path && $value && \is_string($path) && \is_string($value)) {
            $path = [$path => $value];
        }

        // custom set path's alias. e.g: Slim::alias([ 'alias' => 'path' ]);
        if (\is_array($path)) {
            /**
             * @var string $alias
             * @var string $realPath
             */
            foreach ($path as $alias => $realPath) {
                // 1th char must is '@'
                if ($alias[0] !== '@') {
                    continue;
                }

                self::$aliases[$alias] = self::alias($realPath);
            }
        }

        return true;
    }
1005659
private function fixQueryPath($path, FieldInterface $field)
    {
        if (false === strpos($path, '.')) {
            $path = $field->getOption('alias') . '.' . $path;
        }

        return $path;
    }
1090483
protected function _inpath($path, $parent) {
		return $path == $parent
			? true
			: in_array($parent, $this->getParents($path));
	}
1359891
public function get($path=null,$parameters=null)
    {
        if($parameters){
            foreach($parameters as $key=>$parameter)
                $this->addQuery($key,$parameter);
        }
        return $this->startRequest('GET',$path);
    }
110161
protected function loadMessages($path, $locale)
    {
        $filePath = $path . $locale . '.yml';
        $messages = $this->getReader()->read($locale, $filePath);
        return $this->normaliseMessages($messages, $locale);
    }
46322
public function findTranslatedRouteByPath($path, $locale)
    {
        // check if this url is a translated url
        foreach ($this->translatedRoutes as $route) {
            if ($this->translate($route, $locale) == rawurldecode($path))
                return $route;
        }

        return false;
    }
1259114
public function matchPath(ProxyQuery $ProxyQuery, $alias, $field, $data)
    {
        if (!$data || !is_array($data) || !array_key_exists('value', $data)) {
            return false;
        }
        $data['value'] = trim($data['value']);

        if (strlen($data['value']) == 0) {
            return false;
        }

        $qb = $ProxyQuery->getQueryBuilder();
        $qb->leftJoin(sprintf('%s.contentRoute', $alias), 'cpath');
        $parameterName = sprintf('%s_%s', $field, $ProxyQuery->getUniqueParameterId());

        $qb->andWhere(sprintf('%s.%s LIKE :%s', 'cpath', $field, $parameterName));
        $qb->setParameter(sprintf(':%s', $parameterName), '%'.$data['value'].'%');

        return true;
    }
1369446
protected function replaceRouteParameters($path, array &$parameters)
    {
        if (count($parameters) > 0) {
            $path = preg_replace_sub(
                '/\{.*?\}/', $parameters, $this->replaceNamedParameters($path, $parameters)
            );
        }

        return trim(preg_replace('/\{.*?\?\}/', '', $path), '/');
    }
1251964
public function currentPath($params = null, $withParams = true, array $queries = null)
    {
        $base = Base::instance();

        return $this->build(
            $base['ALIAS'],
            ((array) $params) + ($withParams?$base['PARAMS']:[]),
            $queries
        );
    }
222844
private function findRouteByPath($path, $locale)
    {
        $path = '/' . ltrim($path, '/');
        if (!array_key_exists($path, $this->routeCache)) {
            $this->routeCache[$path] = $this->routeRepository->findByPath($path, $locale);
        }

        return $this->routeCache[$path];
    }
679034
public function translate($alias, array $params = [])
    {
        $result = '';

        $values = $this->getMap();
        if (isset($values[$this->getLanguage()][$alias])) {
            $result = $values[$this->getLanguage()][$alias];
        }
        if (isset($values[$alias])) {
            $result = $values[$alias];
        }

        return $result;
    }
959723
protected function loadPath($path, $locale, $group)
    {
        $result = [];
        foreach ($this->paths as $path) {
            $result = array_merge($result, parent::loadPath($path, $locale, $group));
        }

        return $result;
    }
345599
protected function findTranslationsFiles($path, array $locales, array $domains, $autocompletePath = true)
    {
        $finder = null;

        if (preg_match('#^win#i', PHP_OS)) {
            $path = preg_replace('#'. preg_quote(DIRECTORY_SEPARATOR, '#') .'#', '/', $path);
        }

        if (true === $autocompletePath) {
            $dir = (0 === strpos($path, $this->getApplication()->getKernel()->getRootDir() . '/Resources')) ? $path : $path . '/Resources/translations';
        } else {
            $dir = $path;
        }

        $this->output->writeln('<info>*** Using dir ' . $dir . ' to lookup translation files. ***</info>');

        if (is_dir($dir)) {
            $finder = new Finder();
            $finder->files()
                ->name($this->getFileNamePattern($locales, $domains))
                ->in($dir);
        }

        return (null !== $finder && $finder->count() > 0) ? $finder : null;
    }
783308
protected function buildUrlAliasDomainObject(SPIURLAlias $spiUrlAlias, string $path)
    {
        return new URLAlias(
            array(
                'id' => $spiUrlAlias->id,
                'type' => $spiUrlAlias->type,
                'destination' => $spiUrlAlias->destination,
                'languageCodes' => $spiUrlAlias->languageCodes,
                'alwaysAvailable' => $spiUrlAlias->alwaysAvailable,
                'path' => '/' . $path,
                'isHistory' => $spiUrlAlias->isHistory,
                'isCustom' => $spiUrlAlias->isCustom,
                'forward' => $spiUrlAlias->forward,
            )
        );
    }