protected function _getDomainManager( $domain )
	{
		$domain = strtolower( trim( $domain, "/ \n\t\r\0\x0B" ) );

		if( strlen( $domain ) === 0 ) {
			throw new Exception( 'An empty domain is invalid' );
		}

		if( !isset( $this->_domainManagers[$domain] ) )
		{
			$parts = explode( '/', $domain );

			foreach( $parts as $part )
			{
				if( ctype_alnum( $part ) === false ) {
					throw new Exception( sprintf( 'Invalid domain "%1$s"', $domain ) );
				}
			}

			if( ( $domainname = array_shift( $parts ) ) === null ) {
				throw new Exception( 'An empty domain is invalid' );
			}


			if( !isset( $this->_domainManagers[$domainname] ) )
			{
				$iface = 'MShop_Common_Manager_Interface';
				$factory = 'MShop_' . ucwords( $domainname ) . '_Manager_Factory';
				$manager = call_user_func_array( $factory . '::createManager', array( $this->_additional ) );

				if( !( $manager instanceof $iface ) ) {
					throw new Exception( sprintf( 'No factory "%1$s" found', $factory ) );
				}

				$this->_domainManagers[$domainname] = $manager;
			}


			foreach( $parts as $part )
			{
				$tmpname = $domainname .  '/' . $part;

				if( !isset( $this->_domainManagers[$tmpname] ) ) {
					$this->_domainManagers[$tmpname] = $this->_domainManagers[$domainname]->getSubManager( $part );
				}

				$domainname = $tmpname;
			}
		}

		return $this->_domainManagers[$domain];
	}
protected function _getDomainManager( $domain )
	{
		$domain = strtolower( trim( $domain, "/ \n\t\r\0\x0B" ) );

		if( strlen( $domain ) === 0 ) {
			throw new Exception( 'An empty domain is invalid' );
		}

		if( !isset( $this->_domainManagers[$domain] ) )
		{
			$parts = explode( '/', $domain );

			foreach( $parts as $part )
			{
				if( ctype_alnum( $part ) === false ) {
					throw new Exception( sprintf( 'Invalid domain "%1$s"', $domain ) );
				}
			}

			if( ( $domainname = array_shift( $parts ) ) === null ) {
				throw new Exception( 'An empty domain is invalid' );
			}


			if( !isset( $this->_domainManagers[$domainname] ) )
			{
				$iface = 'MShop_Common_Manager_Interface';
				$factory = 'MShop_' . ucwords( $domainname ) . '_Manager_Factory';
				$manager = call_user_func_array( $factory . '::createManager', array( $this->_additional ) );

				if( !( $manager instanceof $iface ) ) {
					throw new Exception( sprintf( 'No factory "%1$s" found', $factory ) );
				}

				$this->_domainManagers[$domainname] = $manager;
			}


			foreach( $parts as $part )
			{
				$tmpname = $domainname .  '/' . $part;

				if( !isset( $this->_domainManagers[$tmpname] ) ) {
					$this->_domainManagers[$tmpname] = $this->_domainManagers[$domainname]->getSubManager( $part );
				}

				$domainname = $tmpname;
			}
		}

		return $this->_domainManagers[$domain];
	}
protected function _getDomainManager ( $ domain ) { $ domain = strtolower ( trim ( $ domain , "/ \n\t\r\0\x0B" ) ) ; if ( strlen ( $ domain ) === 0 ) { throw new Exception ( 'An empty domain is invalid' ) ; } if ( ! isset ( $ this -> _domainManagers [ $ domain ] ) ) { $ parts = explode ( '/' , $ domain ) ; foreach ( $ parts as $ part ) { if ( ctype_alnum ( $ part ) === false ) { throw new Exception ( sprintf ( 'Invalid domain "%1$s"' , $ domain ) ) ; } } if ( ( $ domainname = array_shift ( $ parts ) ) === null ) { throw new Exception ( 'An empty domain is invalid' ) ; } if ( ! isset ( $ this -> _domainManagers [ $ domainname ] ) ) { $ iface = 'MShop_Common_Manager_Interface' ; $ factory = 'MShop_' . ucwords ( $ domainname ) . '_Manager_Factory' ; $ manager = call_user_func_array ( $ factory . '::createManager' , array ( $ this -> _additional ) ) ; if ( ! ( $ manager instanceof $ iface ) ) { throw new Exception ( sprintf ( 'No factory "%1$s" found' , $ factory ) ) ; } $ this -> _domainManagers [ $ domainname ] = $ manager ; } foreach ( $ parts as $ part ) { $ tmpname = $ domainname . '/' . $ part ; if ( ! isset ( $ this -> _domainManagers [ $ tmpname ] ) ) { $ this -> _domainManagers [ $ tmpname ] = $ this -> _domainManagers [ $ domainname ] -> getSubManager ( $ part ) ; } $ domainname = $ tmpname ; } } return $ this -> _domainManagers [ $ domain ] ; }
Returns the manager for the given domain and sub-domains.

@param string $domain String of domain and sub-domains, e.g. "product" or "order/base/service"
@throws Controller_Frontend_Exception If domain string is invalid or no manager can be instantiated
Returns the manager for the given domain and sub - domains .