public function getSiteByAlias(string $alias)
    {
        $retval = false;

        if (!is_string($alias) || strlen($alias) === 0) {
            throw new ENabuCoreException(
                ENabuCoreException::ERROR_UNEXPECTED_PARAM_VALUE,
                array('$alias', print_r($alias, true))
            );
        }

        $nb_site = CNabuSite::findByAlias($alias);
        if ($nb_site instanceof CNabuSite && $nb_site->validateCustomer($this)) {
            if (!$this->nb_site_list->containsKey($nb_site->getId())) {
                $this->nb_site_list->addItem($nb_site);
            }
            $retval = $nb_site;
        }

        return $retval;
    }
public function getSiteByAlias(string $alias)
    {
        $retval = false;

        if (!is_string($alias) || strlen($alias) === 0) {
            throw new ENabuCoreException(
                ENabuCoreException::ERROR_UNEXPECTED_PARAM_VALUE,
                array('$alias', print_r($alias, true))
            );
        }

        $nb_site = CNabuSite::findByAlias($alias);
        if ($nb_site instanceof CNabuSite && $nb_site->validateCustomer($this)) {
            if (!$this->nb_site_list->containsKey($nb_site->getId())) {
                $this->nb_site_list->addItem($nb_site);
            }
            $retval = $nb_site;
        }

        return $retval;
    }
public function getSiteByAlias ( string $ alias ) { $ retval = false ; if ( ! is_string ( $ alias ) || strlen ( $ alias ) === 0 ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_UNEXPECTED_PARAM_VALUE , array ( '$alias' , print_r ( $ alias , true ) ) ) ; } $ nb_site = CNabuSite :: findByAlias ( $ alias ) ; if ( $ nb_site instanceof CNabuSite && $ nb_site -> validateCustomer ( $ this ) ) { if ( ! $ this -> nb_site_list -> containsKey ( $ nb_site -> getId ( ) ) ) { $ this -> nb_site_list -> addItem ( $ nb_site ) ; } $ retval = $ nb_site ; } return $ retval ; }
Gets a Site instance using a possible alias.
@param string $alias The full Alias host name to looking for.
@return CNabuSite|bool Returns a Site instance if exists or false if not.
Gets a Site instance using a possible alias .