original_string: 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];
      }
code: 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];
      }
code_tokens: 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 ] ; }
docstring: Get subdomain by subdomain id
  
  @staticvar   array       $subdomains
  @param       int|null    $subdomainId
  @return      string
docstring_tokens: Get subdomain by subdomain id