@param string|null  $prefix
@param integer|null $type

@return array

@throws Exception\PropertyException
16139
public function getKeys($prefix = null, $type = null)
    {
        $map = $this->getMap();
        $keys = array_keys($map);

        $result = [];

        foreach ($keys as $key) {
            if (null === $prefix || (is_string($prefix) && strpos($key, $prefix))) {
                if (0 === $type) {
                    $result[$key] = $key;
                } else {
                    $v = $map[$key];

                    if ($type === $v->getType()) {
                        $result[$key] = $key;
                    }
                }
            }
        }

        return $result;
    }
1186831
public function setType($type = null)
    {
        if (is_array($type)) {
            $detected = 0;
            foreach ($type as $value) {
                if (is_int($value)) {
                    $detected += $value;
                } elseif (in_array($value, $this->constants)) {
                    $detected += array_search($value, $this->constants);
                }
            }

            $type = $detected;
        } elseif (is_string($type) && in_array($type, $this->constants)) {
            $type = array_search($type, $this->constants);
        }

        if (!is_int($type) || ($type < 0) || ($type > self::TYPE_ALL)) {
            throw new Exception\InvalidArgumentException(sprintf(
                'Unknown type value "%s" (%s)',
                $type,
                gettype($type)
            ));
        }

        $this->options['type'] = $type;
        return $this;
    }
886527
public static function data(String $type = NULL)
    {
        $server =
        [
            NULL                         => $_SERVER,
            'name'                       => $_SERVER['SERVER_NAME']           ?? false,
            'admin'                      => $_SERVER['SERVER_ADMIN']          ?? false,
            'addr'                       => $_SERVER['SERVER_ADDR']           ?? false,
            'port'                       => $_SERVER['SERVER_PORT']           ?? false,
            'protocol'                   => $_SERVER['SERVER_PROTOCOL']       ?? false,
            'signature'                  => $_SERVER['SERVER_SIGNATURE']      ?? false,
            'software'                   => $_SERVER['SERVER_SOFTWARE']       ?? false,
            'remoteAddr'                 => $_SERVER['REMOTE_ADDR']           ?? false,
            'remotePort'                 => $_SERVER['REMOTE_PORT']           ?? false,
            'requestMethod'              => $_SERVER['REQUEST_METHOD']        ?? false,
            'requestUri'                 => $_SERVER['REQUEST_URI']           ?? false,
            'requestScheme'              => $_SERVER['REQUEST_SCHEME']        ?? false,
            'requestTime'                => $_SERVER['REQUEST_TIME']          ?? false,
            'requestTimeFloat'           => $_SERVER['REQUEST_TIME_FLOAT']    ?? false,
            'accept'                     => $_SERVER['HTTP_ACCEPT']           ?? false,
            'acceptCharset'              => $_SERVER['HTTP_ACCEPT_CHARSET']   ?? false,
            'acceptEncoding'             => $_SERVER['HTTP_ACCEPT_ENCODING']  ?? false,
            'acceptLanguage'             => $_SERVER['HTTP_ACCEPT_LANGUAGE']  ?? false,
            'clientIp'                   => $_SERVER['HTTP_CLIENT_IP']        ?? false,
            'xForwardedHost'             => $_SERVER['HTTP_X_FORWARDED_HOST'] ?? false,
            'xForwardedFor'              => $_SERVER['HTTP_X_FORWARDED_FOR']  ?? false,
            'xOriginalUrl'               => $_SERVER['HTTP_X_ORIGINAL_URL']   ?? false,
            'xRequestedWith'             => $_SERVER['HTTP_X_REQUESTED_WITH'] ?? false,
            'connection'                 => $_SERVER['HTTP_CONNECTION']       ?? false,
            'host'                       => $_SERVER['HTTP_HOST']             ?? false,
            'referer'                    => $_SERVER['HTTP_REFERER']          ?? false,
            'userAgent'                  => $_SERVER['HTTP_USER_AGENT']       ?? false,
            'cookie'                     => $_SERVER['HTTP_COOKIE']           ?? false,
            'cacheControl'               => $_SERVER['HTTP_CACHE_CONTROL']    ?? false,
            'https'                      => $_SERVER['HTTPS']                 ?? false,
            'scriptFileName'             => $_SERVER['SCRIPT_FILENAME']       ?? false,
            'scriptName'                 => $_SERVER['SCRIPT_NAME']           ?? false,
            'path'                       => $_SERVER['PATH']                  ?? false,
            'pathInfo'                   => $_SERVER['PATH_INFO']             ?? false,
            'currentPath'                => $_SERVER['PATH_INFO']             ?? $_SERVER['QUERY_STRING'] ?? false,
            'pathTranslated'             => $_SERVER['PATH_TRANSLATED']       ?? false,
            'pathext'                    => $_SERVER['PATHEXT']               ?? false,
            'redirectQueryString'        => $_SERVER['REDIRECT_QUERY_STRING'] ?? false,
            'redirectUrl'                => $_SERVER['REDIRECT_URL']          ?? false,
            'redirectStatus'             => $_SERVER['REDIRECT_STATUS']       ?? false,
            'phpSelf'                    => $_SERVER['PHP_SELF']              ?? false,
            'queryString'                => $_SERVER['QUERY_STRING']          ?? false,
            'documentRoot'               => $_SERVER['DOCUMENT_ROOT']         ?? false,
            'windir'                     => $_SERVER['WINDIR']                ?? false,
            'comspec'                    => $_SERVER['COMSPEC']               ?? false,
            'systemRoot'                 => $_SERVER['SystemRoot']            ?? false,
            'gatewayInterface'           => $_SERVER['GATEWAY_INTERFACE']     ?? false
        ];

        if( isset($server[$type]) )
        {
            if( is_array($server[$type]) )
            {
                return $server[$type];
            }
            else
            {
                $return = htmlspecialchars($server[$type], ENT_QUOTES, "utf-8");
            }
        }
        elseif( isset($_SERVER[$type]) )
        {
            $return = htmlspecialchars($_SERVER[$type], ENT_QUOTES, "utf-8");
        }

        // 5.4.3[edited]
        return str_replace('&amp;', '&', $return) ?: false;
    }
1022300
protected static function getClassMethodsByPrefix($prefix = null)
    {
        //
        $attribute = 'MethodsByPrefix:'.$prefix;

        if (!static::hasClassAttribute($attribute)) {
            $class = static::getClass();
            $allMethods = get_class_methods($class);
            $methods = [];

            if (count($allMethods) > 0) {
                foreach ($allMethods as $method) {
                    if (preg_match('/^'.$prefix.'/i', $method)) {
                        $methods[] = $method;
                    }
                }
            }
            asort($methods);

            static::setClassAttribute($attribute, $methods);
        }

        //
        return static::getClassAttribute($attribute);
    }
515294
public static function checkUrlPrefix($prefix) {
        return isset(self::$prefix['check'][ $prefix ]) ? self::$prefix['check'][ $prefix ] : null;
    }
1364719
protected function getHttpHeaders(string $prefix = null): array
    {
        $headers = [];

        // Get all headers
        if (function_exists('\getallheaders')) {
            $headers = \getallheaders() ?: [];
        } else {
            foreach ($_SERVER as $name => $value) {
                if (substr($name, 0, 5) == 'HTTP_') {
                    $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
                } else {
                    if ($name === 'CONTENT_TYPE') {
                        $headers['Content-Type'] = $value;
                    }
                }
            }
        }

        // Headers filter
        if (!empty($prefix)) {
            $prefixLength = mb_strlen($prefix);

            $headers =
                array_filter(
                    $headers,
                    function ($key) use ($prefix, $prefixLength) {
                        return substr($key, 0, $prefixLength) == $prefix;
                    }, ARRAY_FILTER_USE_KEY);
        }

        return $headers;
    }
857
private function extractPrefixKeyValueData($prefix)
    {
        $result = null;
        
        // If it has key-value data, as evidenced by the raw prefix string
        // being a JSON object (not JSON array), use it.
        if (substr($prefix, 0, 1) === '{') {
            if ($this->isJsonString($prefix)) {
                $result = Json::decode($prefix);
            }
        }
        
        return $result;
    }
1347715
public static function serialize($prefix, array $typoscript, $indent = 0)
    {
        $serialized = [];

        // Sort the TypoScript fragment
        ksort($typoscript, SORT_NATURAL);

        // Run through the TypoScript fragment
        foreach ($typoscript as $key => $value) {
            $line = str_repeat(' ', $indent * 4);
            $line .= trim(strlen($prefix) ? "$prefix.$key" : $key, '.');

            // If the value is a list of values
            if (is_array($value)) {

                // If the list has only one element
                if (count($value) === 1) {
                    $line .= '.'.self::serialize('', $value, 0);
                } else {
                    $line .= ' {'.PHP_EOL.self::serialize('', $value, $indent + 1).PHP_EOL.'}';
                }

                // Else if it's a multiline value
            } elseif (preg_match('/\R/', $value)) {
                $line .= ' ('.PHP_EOL.$value.PHP_EOL.')';

                // Else: Simple assignment
            } else {
                $line .= ' = '.$value;
            }
            $serialized[] = $line;
        }

        return implode(PHP_EOL, $serialized);
    }
582782
private function apply_prefix( $prefix_type, $name ) {

		switch( $prefix_type ) {
			case 'network' :
				return $this->network_prefix . $name;
			case 'site' :
				return $this->site_prefix . $name;
		}

		throw new InvalidTableSchema( "Unknown prefix type: {$prefix_type}" );
	}
419753
public void loadProperties(String prefix) {
        List<Property> props = null;
        
        try {
            props = getListByPrefix(prefix);
        } catch (Exception e) {
            log.error("Error retrieving properties with prefix: " + prefix, e);
            return;
        }
        
        for (Property prop : props) {
            if (prop.getName() != null) {
                this.properties.put(prop.getName(), prop);
            }
        }
    }
998757
public function hasType( $name, $prefix = null )
	{
		return isset( $this->types[ is_null( $prefix ) ? $name : "$prefix:$name" ] );
	}
548482
protected function getInheritedProperties($type, array $schema, $isRoot = true)
    {
        if (!isset($schema['types'][$type])) {
            throw new \Exception('Unknown type '.$type);
        }

        $typeSchema = $schema['types'][$type];
        $properties = [];
        if (!$isRoot) {
            foreach ($typeSchema['specific_properties'] as $property) {
                if (!isset($schema['properties'][$property])) {
                    continue;
                }

                $properties[$property] = $property;
            }
        }

        if ($typeSchema['ancestors']) {
            $properties = array_merge(
                $properties,
                $this->getInheritedProperties(end($typeSchema['ancestors']), $schema, false)
            );
        }

        ksort($properties);

        return $properties;
    }
52248
public function getTaxonomyForPrefix( $prefix )
	{
		if ( ! $prefix ) return null;

		$taxonomies = array_filter(
			$this->getImportedSchemas(),
			function( $taxonomy ) use( $prefix ) { return $taxonomy->getPrefix() == $prefix; }
		);
		if ( ! $taxonomies ) return null;
		return reset( $taxonomies );
	}
1013317
public static function generatePropertyMethod(string $prefix, string $property): string
    {
        return strtolower($prefix).ucfirst(self::normalizeProperty($property));
    }
978687
public static function prefix($prefix = null)
	{
		if(null !== $prefix)
		{
			self::$prefix = $prefix;
		}
		return self::$prefix;
	}
1127445
public function getNamespaceForPrefix( $prefix )
	{
		// Initialize $this->documentPrefixes
		$this->getDocumentNamespaces();

		if ( ! isset( $this->documentPrefixes[ $prefix ] ) )
		{
			// Look for prefix in imported taxonmies
			$taxonomies = array_filter( $this->context->importedSchemas, function( $xbrl ) use ( $prefix ) { return $xbrl->getPrefix() == $prefix; } );
			return $taxonomies ? key( $taxonomies ): null;
		}
		return $this->documentPrefixes[ $prefix ];
	}
1248238
public static function getNaming($name, $prePostFix, $type = 'prefix', $symbol = '_')
    {
        if ($type == 'prefix') {
            return static::toCamelCase($prePostFix.$symbol.$name, $symbol);
        } else if ($type == 'postfix') {
            return static::toCamelCase($name.$symbol.$prePostFix, $symbol);
        }

        return null;
    }