Returns the list of internally available locales and already loaded custom locales.
(It will ignore custom translator dynamic loading.)

@param string $prefix prefix required to filter result

@return array
181288
public function getAvailableLocales($prefix = '')
    {
        $locales = [];
        foreach ($this->getLocalesFiles($prefix) as $file) {
            $locales[] = substr($file, strrpos($file, '/') + 1, -4);
        }

        return array_unique(array_merge($locales, array_keys($this->messages)));
    }
970445
public function setPrefix($prefix)
    {
        $prefix = "/" . ltrim($prefix, "/");
        $routes = [];
        foreach ($this->routes as $route)
            $routes[] = $route->setPattern(rtrim($prefix . $route->getPattern(), "/"));
        $this->routes = $routes;
        return $this;
    }
978687
public static function prefix($prefix = null)
	{
		if(null !== $prefix)
		{
			self::$prefix = $prefix;
		}
		return self::$prefix;
	}
1114092
protected function localizeCollectionLocaleParameter($prefix, RouteCollection $collection)
    {
        $localizedPrefixes = array();
        foreach ($collection->all() as $name => $route) {
            $locale = $route->getDefault(self::LOCALE_PARAM);
            if ($locale === null) {
                // No locale so nothing to do
                $routePrefix = $prefix;
            } else {
                // A locale was found so localize the prefix
                if (!isset($localizedPrefixes[$locale])) {
                    $localizedPrefixes[$locale] = preg_replace(static::LOCALE_REGEX, $locale, $prefix);
                }
                $routePrefix = $localizedPrefixes[$locale];
            }
            $route->setPath('/' . $routePrefix . $route->getPath());
        }
    }
730314
private function getCompletionsForKeywords(string $prefix): \Generator
    {
        foreach (self::KEYWORDS as $keyword) {
            if (nameStartsWith($keyword, $prefix)) {
                $item = new CompletionItem($keyword, CompletionItemKind::KEYWORD);
                $item->insertText = $keyword;
                yield $keyword => $item;
            }
        }
    }
1235060
public function getNamespaceForPrefix( $prefix )
	{
		if ( ! isset( $this->instance_namespaces[ $prefix ] ) ) return null;
		return $this->instance_namespaces[ $prefix ];
	}
1350579
private function getWhere($prefix)
    {
        $result = '';
        // Only return where clause if there actually is some data
        if (count($this->where) > 0 || count($this->searchFields) > 0) {
            $wheres = [];
            $searches = [];

            $whereKeys = array_keys($this->where);

            // Get all fields which will appear in the where clause
            // The search fields already have the right format, and we have to use only the keys of where, because its
            // values contain the filter expression
            $fields = array_unique(array_merge($whereKeys, $this->searchFields));

            foreach ($fields as $key) {
                $keys = explode('_', $key);
                $prefixActual = $prefix;
                if (1 == count($keys)) {
                    $col = $keys[0];
                } else {
                    $i = count($keys);
                    $prefixActual = $keys[$i - 2];
                    $col = $keys[$i - 1];
                }
                // Add where clause y.z for x_y_z
                // FIXME DQL injection?
                if (in_array($key, $whereKeys)) {
                    $wheres[] = $prefixActual . '.' . $col . ' = ' . $this->where[$key];
                }
                if (in_array($key, $this->searchFields)) {
                    $comparator = '=';
                    $search = ':strictSearch';

                    // search by like
                    if (in_array($key, $this->searchTextFields)) {
                        $comparator = 'LIKE';
                        $search = ':search';
                    }
                    $searches[] = $prefixActual . '.' . $col . ' ' . $comparator . ' ' . $search;
                }
            }

            // concatenate the query
            if (!empty($wheres)) {
                $result .= implode(' AND ', $wheres);
            }

            if (!empty($searches)) {
                if ('' != $result) {
                    $result .= ' AND ';
                }
                $result .= '(' . implode(' OR ', $searches) . ')';
            }

            $result = 'WHERE ' . $result;
        }

        return $result;
    }
694258
protected function getLinksListRepresentation(?string $prefix, iterable $links): array
    {
        $result = [];

        foreach ($links as $link) {
            \assert($link instanceof BaseLinkInterface);
            $result[] = $link->canBeShownAsString() === true ?
                $link->getStringRepresentation($prefix) : $link->getArrayRepresentation($prefix);
        }

        return $result;
    }
959644
public function prefix($prefix = '') {
        if (empty($prefix) && null !== $prefix) {
            return $this->prefix;
        }
        else {
            $this->prefix = $prefix;
        }
    }
1112982
public function prepend($prefix): Utility
    {
        return new static(new static($prefix, $this->encoding) . $this->string, $this->encoding);
    }
458503
public function prefix($prefix = null)
	{
		if (null !== $prefix)
		{
			$this->prefix = $prefix;
		}
		return $this->prefix;
	}
364883
protected function _routerPrefixes()
    {
        $cache = static::cache('_routerPrefixes');
        if (!$cache) {
            $prefixes = [];
            foreach (Router::routes() as $route) {
                if (empty($route->defaults['prefix'])) {
                    continue;
                } else {
                    $prefix = Inflector::camelize($route->defaults['prefix']);
                    if (!in_array($prefix, $prefixes)) {
                        $prefixes[] = $prefix;
                    }
                }
            }

            $cache = static::cache('_routerPrefixes', $prefixes);
        }

        return $cache;
    }
385923
public function prefix($prefix)
    {
        if ($this->parent && $this->parent->getOption('prefix')) {
            $prefix = $this->parent->getOption('prefix') . $prefix;
        }

        return $this->option('prefix', $prefix);
    }
561273
protected function __prefixExists($prefix)
    {
        if (Hash::get($this->prefixes, ucfirst($prefix)) == null) {
            return false;
        }

        return true;
    }
782446
private function prefix($prefix)
    {
        if ($prefix) {
            $prefixLastChar = substr($prefix, -1);

            if ($prefixLastChar != '.' && $prefixLastChar != ':') {
                $prefix .= '.';
            }
        }

        return $prefix;
    }
955777
protected function getConstNameToIds($prefix)
    {
        if (!isset(self::$constNameToIds[$prefix])) {
            foreach ($this->getConsts($prefix) as $const) {
                self::$constNameToIds[$prefix][$const['name']] = $const['id'];
            }
        }

        return self::$constNameToIds[$prefix];
    }
662554
public function filterPrefix($prefix)
    {
        $names = [];

        foreach ($this->getMethods() as $method) {
            if ($method->isPublic() && substr_count($method->getName(), $prefix, null, strlen($prefix))) {
                $names[] = $method->getName();
            }
        }

        return $names;
    }