Get the guild's prefix - or the default prefix. Null means only mentions.
@param \CharlotteDunois\Yasmin\Models\Guild|null  $guild
@return string|null
501950
function getGuildPrefix(?\CharlotteDunois\Yasmin\Models\Guild $guild = null) {
        if($guild !== null && $this->provider !== null) {
            try {
                $prefix = $this->provider->get($guild, 'commandPrefix', 404);
                if($prefix !== 404 && $prefix !== '') {
                    return $prefix;
                }
            } catch (\BadMethodCallException $e) {
                return $this->commandPrefix;
            }
        }
        
        return $this->commandPrefix;
    }
950406
public function get_namespace($name = null)
    {
        $ns = $this->namespace;

        if ($name) {
            // an alias for BC
            if ($name == 'prefix') {
                $name = 'prefix_in';
            }

            return isset($ns[$name]) ? $ns[$name] : null;
        }

        unset($ns['prefix_in'], $ns['prefix_out']);

        return $ns;
    }
512641
private function prefix()
    {
        $result = $this->lineBreak() . $this->directive . ':';
        if ($this->level === 0) {
            return $result;
        }
        return ucwords($result) . ' ';
    }
541851
public function getGuildApi()
    {
        if (!$this->apis->has('guild')) {
            $this->apis->set('guild', new Guild($this));
        }

        return $this->apis->get('guild');
    }
170960
protected function prefixMessage($message) {
        if ($this->prefix !== null) {
            return s('%s: %s', $this->prefix, $message);
        }

        return $message;
    }
1156332
public function getKeyword($language = null)
    {
        if (empty($language)) {
            $language = $this->mainLanguageCode;
        }

        if (!is_array($this->keywords) || !array_key_exists($language, $this->keywords)) {
            return null;
        }

        return $this->keywords[$language];
    }
911502
public function getItagInfo($itag)
	{
		$itag = '' . $itag;
		$itags = $this->getItags();

		if (property_exists($itags, $itag))
			return $itags->$itag;

		return null;
	}
780484
public function table_prefix($table = null)
	{
		if ($table !== null)
		{
			return $this->_config['table_prefix'] .$table;
		}

		return $this->_config['table_prefix'];
	}
1325847
public function getPrefixForNamespace( $namespace )
	{
		if (
			  ! isset( $this->cacheNamespaces ) ||
			  count( $this->cacheNamespaces ) != count( $this->instance_namespaces )
		   )
		{
			$this->cacheNamespaces = array_flip( $this->instance_namespaces );
			// If the default namespace is one of the standards ones then the prefix may be missing
			$standardNamespaces = array_flip( XBRL_Constants::$standardPrefixes );
			if ( isset( $this->instance_namespaces[''] ) )
			{
				if ( isset( $standardNamespaces[ $this->instance_namespaces[''] ] ) )
				{
					$this->cacheNamespaces[ $this->instance_namespaces[''] ] = $standardNamespaces[ $this->instance_namespaces[''] ];
				}
			}
		}

		return isset( $this->cacheNamespaces[ $namespace ] )
			? $this->cacheNamespaces[ $namespace ]
			: false;
	}
458503
public function prefix($prefix = null)
	{
		if (null !== $prefix)
		{
			$this->prefix = $prefix;
		}
		return $this->prefix;
	}
204481
public function uri_to_qname($uri) {
        if (preg_match('~^(.*[\/\#])([a-z0-9\-\_\:]+)$~i', $uri, $m)) {
            $ns = $m[1];
            $localname = $m[2];
            $prefix = $this->get_prefix($ns);
            if ( $prefix != null && $prefix !== FALSE) {
                return $prefix . ':' . $localname;
            }
        }
        return null;
    }
177078
public function getRouteLocalePrefix($locale = null) {
        if (is_null($locale)) {
            $locale = $this->getLocaleFromRoute();
        }
        return $this->getDefaultRoutelocale() === $locale ? ($this->isUsePrefixForDefaultLocale() ? $locale : '') : $locale;
    }
974018
public function getPlaceholder($lang = null)
    {
        $lang = empty($lang) ? $this->getDefaultLanguage() : $lang;

        if (!isset($this->placeholders[$lang])) {
            return $this->getFirstPlaceholder();
        }

        return $this->placeholders[$lang];
    }
1082677
public static function createUniqueName($group = null)
    {
        $group = empty($group) ? self::DEFAULT_GROUP : $group;
        $group = Uuid::uuid3(self::GROUP_NS, $group)->toString();
        $name = Uuid::uuid4()->toString();

        return $group.'-'.$name;
    }
1366109
public function prefix($path)
    {
        $path = $this->cleanPath($path);
        return preg_match('|^(?P<prefix>([a-zA-Z]+:)?//?)|', $path, $matches) ? $matches['prefix'] : null;
    }
1078777
static public function GetRootDomain($domain=null) 
	{
	    $domain = !empty($domain) ? $domain : (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : null);
	    if (!$domain) {
	        return 'localhost';
	    }
	    
	    $re_domain = '';
	    $domain_postfix_cn_array = array("com", "net", "org", "gov", "edu", "com.cn", "net.cn", "cn");
	    $array_domain = explode(".", $domain);
	    $array_num = count($array_domain) - 1;
	    if ($array_domain[$array_num] == 'cn') {
	        if (in_array($array_domain[$array_num - 1], $domain_postfix_cn_array)) {
	            $re_domain = $array_domain[$array_num - 2] . "." . $array_domain[$array_num - 1] . "." . $array_domain[$array_num];
	        } else {
	            $re_domain = $array_domain[$array_num - 1] . "." . $array_domain[$array_num];
	        }
	    } else {
	        $re_domain = $array_domain[$array_num - 1] . "." . $array_domain[$array_num];
	    }
	    return $re_domain;
	}
480027
public function getGuildMember4GuildId($guildId)
    {
        $query = $this->createQueryBuilder('p')
            ->select('p', 'character')
            ->join('p.character', 'character')
            ->where('p.guild = :guild')
            ->setParameter('guild', $guildId)
            ->orderBy('p.memberClass', 'asc')
            ->addOrderBy('p.level', 'desc');

        return $query->getQuery()->getResult();
    }