public function getSiteByKey(string $key)
    {
        $retval = false;

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

        $nb_site = $this->nb_site_list->getItem($key, CNabuSiteList::INDEX_KEY);

        if ($nb_site instanceof CNabuSite) {
            $nb_site->setCustomer($this);
            $retval = $nb_site;
        }

        return $retval;
    }
public function getSiteByKey(string $key)
    {
        $retval = false;

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

        $nb_site = $this->nb_site_list->getItem($key, CNabuSiteList::INDEX_KEY);

        if ($nb_site instanceof CNabuSite) {
            $nb_site->setCustomer($this);
            $retval = $nb_site;
        }

        return $retval;
    }
public function getSiteByKey ( string $ key ) { $ retval = false ; if ( strlen ( $ key ) === 0 ) { throw new ENabuCoreException ( ENabuCoreException :: ERROR_UNEXPECTED_PARAM_VALUE , array ( '$key' , print_r ( $ key , true ) ) ) ; } $ nb_site = $ this -> nb_site_list -> getItem ( $ key , CNabuSiteList :: INDEX_KEY ) ; if ( $ nb_site instanceof CNabuSite ) { $ nb_site -> setCustomer ( $ this ) ; $ retval = $ nb_site ; } return $ retval ; }
Gets a Site instance using their key.
@param string $key Key of the Site to be retrieved.
@return CNabuSite|bool Returns a Site instance if exists or false if not.
Gets a Site instance using their key .