function from($namespacePath)
    {
        if ($namespacePath === '')
            # from recursion calls
            return $this;

        // ..

        $cNamespace = $this->_normalizeNamespace($namespacePath);

        if (false === strstr($cNamespace, self::SEPARATOR)) {
            ## recursion fallback here !!
            if (!isset($this->__nestRight[$cNamespace]))
                return false;

            return $this->__nestRight[$cNamespace];
        }

        // ..

        $namespacePath = rtrim($namespacePath, self::SEPARATOR);
        $brkNamespace  = explode(self::SEPARATOR, $namespacePath);


        ## /root/to/nested/namespace
        $cNamespace   = array_shift($brkNamespace);
        $cContainer   = $this;
        if ($cNamespace === '') {
            ## Start with / (separator)
            #- Goto Root Container
            while ($cContainer->__nestLeft)
                $cContainer = $cContainer->__nestLeft;
        }
        else $cContainer = $this->from($cNamespace); ## fallback

        ## fallback recursion from root parent
        return ($cContainer == false) ? $cContainer : $cContainer->from(implode(self::SEPARATOR, $brkNamespace));
    }
function from($namespacePath)
    {
        if ($namespacePath === '')
            # from recursion calls
            return $this;

        // ..

        $cNamespace = $this->_normalizeNamespace($namespacePath);

        if (false === strstr($cNamespace, self::SEPARATOR)) {
            ## recursion fallback here !!
            if (!isset($this->__nestRight[$cNamespace]))
                return false;

            return $this->__nestRight[$cNamespace];
        }

        // ..

        $namespacePath = rtrim($namespacePath, self::SEPARATOR);
        $brkNamespace  = explode(self::SEPARATOR, $namespacePath);


        ## /root/to/nested/namespace
        $cNamespace   = array_shift($brkNamespace);
        $cContainer   = $this;
        if ($cNamespace === '') {
            ## Start with / (separator)
            #- Goto Root Container
            while ($cContainer->__nestLeft)
                $cContainer = $cContainer->__nestLeft;
        }
        else $cContainer = $this->from($cNamespace); ## fallback

        ## fallback recursion from root parent
        return ($cContainer == false) ? $cContainer : $cContainer->from(implode(self::SEPARATOR, $brkNamespace));
    }
function from ( $ namespacePath ) { if ( $ namespacePath === '' ) # from recursion calls return $ this ; // .. $ cNamespace = $ this -> _normalizeNamespace ( $ namespacePath ) ; if ( false === strstr ( $ cNamespace , self :: SEPARATOR ) ) { ## recursion fallback here !! if ( ! isset ( $ this -> __nestRight [ $ cNamespace ] ) ) return false ; return $ this -> __nestRight [ $ cNamespace ] ; } // .. $ namespacePath = rtrim ( $ namespacePath , self :: SEPARATOR ) ; $ brkNamespace = explode ( self :: SEPARATOR , $ namespacePath ) ; ## /root/to/nested/namespace $ cNamespace = array_shift ( $ brkNamespace ) ; $ cContainer = $ this ; if ( $ cNamespace === '' ) { ## Start with / (separator) #- Goto Root Container while ( $ cContainer -> __nestLeft ) $ cContainer = $ cContainer -> __nestLeft ; } else $ cContainer = $ this -> from ( $ cNamespace ) ; ## fallback ## fallback recursion from root parent return ( $ cContainer == false ) ? $ cContainer : $ cContainer -> from ( implode ( self :: SEPARATOR , $ brkNamespace ) ) ; }
Retrieve Nested Container

[code:]
from('/') // means from first parent container
from('nested/containers') // means nested>containers to this
[code]

@param string $namespacePath

@return Container|false False For namespace not found
@throws \Exception
Retrieve Nested Container