Create the namespaced wrapper

@param  string $namespace
@return Wrapper
557054
public function createWrapper($namespace = null) {
		if (! isset($this->_wrappers[$namespace])) {
			$wrapper  = new Wrapper($this->getBackend(), $namespace);
			$lifetime = $this->getDefaultLifetime();
			
			if ($lifetime !== null) {
				$wrapper->setDefaultLifetime($lifetime);
			}
			
			$this->_wrappers[$namespace] = $wrapper;
		}
		
		return $this->_wrappers[$namespace];
	}
333475
public function registerNamespace($namespace, $directory)
    {
        $namespace = rtrim($namespace, self::NS_SEPARATOR). self::NS_SEPARATOR;
        $this->namespaces[$namespace] = $this->normalizeDirectory($directory);
        return $this;
    }
473255
public function setNamespace($namespace)
    {
        if (is_string($namespace) === false) {
            $msg = "The namespace argument must be a string.";
            throw new InvalidArgumentException($msg);
        } elseif ($namespace === '') {
            $msg = "The namespace argument must be a non-empty string.";
            throw new InvalidArgumentException($msg);
        } else {
            $this->namespace = $namespace;
        }
    }
986491
public function getPrefixForDocumentNamespace( $namespace )
	{
		if ( is_null( $this->cacheDocumentNamespaces ) )
		{
			$this->cacheDocumentNamespaces = array_flip( $this->instance_xml->getDocNamespaces() );
			// If the default namespace is one of the standards ones then the prefix may be missing
			$standardNamespaces = array_flip( XBRL_Constants::$standardPrefixes );
			$docNamespace = array_search( '', $this->cacheDocumentNamespaces );
			if ( $docNamespace )
			{
				if ( isset( $standardNamespaces[ $docNamespace ] ) )
				{
					$this->cacheDocumentNamespaces[ $docNamespace ] = $standardNamespaces[ $docNamespace ];
				}
				else
				{
					// Get the namespace for the respective namespace
					$taxonomy = $this->getInstanceTaxonomy()->getTaxonomyForNamespace( $docNamespace );
					if ( $taxonomy )
					{
						$this->cacheDocumentNamespaces[ $docNamespace ] = $taxonomy->getPrefix();
					}
				}
			}
		}

		return isset( $this->cacheDocumentNamespaces[ $namespace ] )
			? $this->cacheDocumentNamespaces[ $namespace ]
			: false;
	}
923325
private function getMetadataForNamespace($namespace)
    {
        $metadata = [];
        foreach ($this->getAllMetadata() as $m) {
            if (strpos($m->name, $namespace) !== 0) {
                continue;
            }

            $metadata[] = $m;
        }

        return new ClassMetadataCollection($metadata);
    }
1084974
public function invalidate($namespace)
	{
		if($this->prefix) {
			$namespace = $this->prefix.$this->delimiter.$namespace;
		}

		return $this->mapper->invalidate($namespace);
	}
1336480
protected function fetchMessagesFromNamespace($namespace)
    {
        $this->setNamespace($namespace);

        if ($this->hasMessages()) {
            $messages = $this->getMessagesFromNamespace($namespace);
            // reset namespace
            $this->setNamespace();

            return $this->buildMessage($namespace, $messages);
        }

        return '';
    }
288665
private function setNamespaceKey($namespace) {

        $uId = UniqueId::generate(64);

        return $this->getInstance()->set($namespace, $uId, 0) === false ? false : $uId;

    }
214711
public function getMapping($namespace)
    {
        $cacheName = 'ongr.metadata.document.'.md5($namespace);

        $namespace = $this->getClassName($namespace);
        $this->enableCache && $mapping = $this->cache->fetch($cacheName);

        if (isset($mapping) && false !== $mapping) {
            return $mapping;
        }

        $mapping = $this->getDocumentReflectionMapping(new \ReflectionClass($namespace));

        $this->enableCache && $this->cache->save($cacheName, $mapping);

        return $mapping;
    }
1106048
private function namespace_to_dir( $namespace ) {
		$namespace = ltrim( $namespace, '\\' );
		$dir       = null;
		if ( preg_match( "#\A{$this->app->define->plugin_namespace}#", $namespace ) ) {
			$namespace = preg_replace( "#\A{$this->app->define->plugin_namespace}#", '', $namespace );
			$dir       = $this->app->define->plugin_src_dir;
		} elseif ( preg_match( "#\A{$this->app->define->lib_namespace}#", $namespace ) ) {
			$namespace = preg_replace( "#\A{$this->app->define->lib_namespace}#", '', $namespace );
			$dir       = $this->app->define->lib_src_dir;
		}

		if ( isset( $dir ) ) {
			$namespace = ltrim( $namespace, '\\' );
			$namespace = strtolower( $namespace );
			$path      = $dir . DS . str_replace( '\\', DS, $namespace );
			$path      = rtrim( $path, DS );
			if ( is_dir( $path ) ) {
				return $path;
			}
		}

		return false;
	}
1154700
public function findNamespace(string $namespace): string
	{
		$allNamespaces = $this->getNamespaces();

		$expr = preg_replace_callback(
			'{([^:]+|)}',
			function ($matches)
			{
				return preg_quote($matches[1]) . '[^:]*';
			},
			$namespace
		);

		$namespaces = preg_grep('{^' . $expr . '}', $allNamespaces);

		if (empty($namespaces))
		{
			throw new NamespaceNotFoundException(sprintf('There are no commands defined in the "%s" namespace.', $namespace));
		}

		$exact = \in_array($namespace, $namespaces, true);

		if (\count($namespaces) > 1 && !$exact)
		{
			throw new NamespaceNotFoundException(sprintf('The namespace "%s" is ambiguous.', $namespace));
		}

		return $exact ? $namespace : reset($namespaces);
	}
1023148
public function attachNamespace($namespace, $paths)
    {
        if (isset($this->namespaces[$namespace])) {
            if (is_array($paths)) {
                $this->namespaces[$namespace] = array_merge($this->namespaces[$namespace], $paths);
            } else {
                $this->namespaces[$namespace][] = $paths;
            }
        } else {
            $this->namespaces[$namespace] = (array) $paths;
        }

        return $this;
    }
854492
private function getParametersForNameSpace($namespace)
    {
        $parameters = array();
        foreach ($this->parameters as $key => $value) {
            if (0 === strpos($key, $namespace . ':')) {
                $parameters[substr($key, strlen($namespace) + 1)] = $value;
            }
        }
        return $parameters;
    }
114664
public function setNameSpace($nameSpace)
    {
        $this->paginationPageParameter .= '_' . $nameSpace;
        $this->sortColumnParameter .= '_' . $nameSpace;
        $this->sortDirectionParameter .= '_' . $nameSpace;
    }
832073
static public function formatNamespace($namespace)
	{
	    if (is_array($namespace)) {
	        foreach ($namespace as $k => $v) {
	            $namespace[$k] =  static::formatNamespace($v);
	        }
	    } else {
	        $namespace = trim(str_replace('/', '\\', $namespace), '\\') . '\\';
	    }
	    
	    return $namespace;
	}
678384
public function setNamespaces(array $namespaces)
    {
        $this->namespaces = array();

        foreach ($namespaces as $prefix => $uri) {
            $this->addNamespace($uri, $prefix);
        }

        return $this;
    }
585807
public function setNamespaces($namespaces)
    {
        if (!$namespaces instanceof PriorityQueue) {
            $namespaces = new PriorityQueue($namespaces);
        }

        $this->namespaces = $namespaces;

        return $this;
    }