protected function getSubdomain( $subdomainId = null )
    {
        static $subdomains = array();
        $siteInfo = $this->getSiteInfo();

        if ( empty( $subdomainId ) || $siteInfo->getSubdomainId() == $subdomainId )
        {
            return $siteInfo->getSubdomain();
        }

        if ( ! isset( $subdomains[$subdomainId] ) )
        {
            /* @var $model \Grid\Core\Model\Uri\Model */
            $service    = $this->getServiceLocator();
            $model      = $service->get( 'Grid\Core\Model\SubDomain\Model' );
            $subdomain  = $model->find( $subdomainId );

            if ( empty( $subdomain ) )
            {
                $subdomains[$subdomainId] = '';
            }
            else
            {
                $subdomains[$subdomainId] = $subdomain->subdomain;
            }
        }

        return $subdomains[$subdomainId];
    }
protected function getSubdomain( $subdomainId = null )
    {
        static $subdomains = array();
        $siteInfo = $this->getSiteInfo();

        if ( empty( $subdomainId ) || $siteInfo->getSubdomainId() == $subdomainId )
        {
            return $siteInfo->getSubdomain();
        }

        if ( ! isset( $subdomains[$subdomainId] ) )
        {
            /* @var $model \Grid\Core\Model\Uri\Model */
            $service    = $this->getServiceLocator();
            $model      = $service->get( 'Grid\Core\Model\SubDomain\Model' );
            $subdomain  = $model->find( $subdomainId );

            if ( empty( $subdomain ) )
            {
                $subdomains[$subdomainId] = '';
            }
            else
            {
                $subdomains[$subdomainId] = $subdomain->subdomain;
            }
        }

        return $subdomains[$subdomainId];
    }
protected function getSubdomain ( $ subdomainId = null ) { static $ subdomains = array ( ) ; $ siteInfo = $ this -> getSiteInfo ( ) ; if ( empty ( $ subdomainId ) || $ siteInfo -> getSubdomainId ( ) == $ subdomainId ) { return $ siteInfo -> getSubdomain ( ) ; } if ( ! isset ( $ subdomains [ $ subdomainId ] ) ) { /* @var $model \Grid\Core\Model\Uri\Model */ $ service = $ this -> getServiceLocator ( ) ; $ model = $ service -> get ( 'Grid\Core\Model\SubDomain\Model' ) ; $ subdomain = $ model -> find ( $ subdomainId ) ; if ( empty ( $ subdomain ) ) { $ subdomains [ $ subdomainId ] = '' ; } else { $ subdomains [ $ subdomainId ] = $ subdomain -> subdomain ; } } return $ subdomains [ $ subdomainId ] ; }
Get subdomain by subdomain id

@staticvar   array       $subdomains
@param       int|null    $subdomainId
@return      string
Get subdomain by subdomain id