protected function getAccountId($account)
    {
        if($account instanceof Account){
            if(!empty($account->id)){
                $id = $account->id;
            } elseif(!empty($account->domain)){
                $id = $this->api->searchAccountId($account->domain);
            } else {
                throw new YouHostingException("You need to provide either an account ID (recommended) or account domain to search for");
            }
        } elseif(is_numeric($account)){
            $id = $account;
        } else {
            $id = $this->api->searchAccountId($account);
        }

        return (int)$id;
    }
protected function getAccountId($account)
    {
        if($account instanceof Account){
            if(!empty($account->id)){
                $id = $account->id;
            } elseif(!empty($account->domain)){
                $id = $this->api->searchAccountId($account->domain);
            } else {
                throw new YouHostingException("You need to provide either an account ID (recommended) or account domain to search for");
            }
        } elseif(is_numeric($account)){
            $id = $account;
        } else {
            $id = $this->api->searchAccountId($account);
        }

        return (int)$id;
    }
protected function getAccountId ( $ account ) { if ( $ account instanceof Account ) { if ( ! empty ( $ account -> id ) ) { $ id = $ account -> id ; } elseif ( ! empty ( $ account -> domain ) ) { $ id = $ this -> api -> searchAccountId ( $ account -> domain ) ; } else { throw new YouHostingException ( "You need to provide either an account ID (recommended) or account domain to search for" ) ; } } elseif ( is_numeric ( $ account ) ) { $ id = $ account ; } else { $ id = $ this -> api -> searchAccountId ( $ account ) ; } return ( int ) $ id ; }
Get an account id from either an id, email or account object

@param $account
@return int
@throws YouHostingException
Get an account id from either an id email or account object