public function authenticate()
    {
        if (!isset($this->account_id)) {
            $accounts = $this->authentication->login();
            $allAccounts = $accounts->getLoginAccounts();
            $account = $allAccounts[0];
            $this->account_id = $account->getAccountId();
        }

        $this->authenticated = true;

        return $this;
    }
public function authenticate()
    {
        if (!isset($this->account_id)) {
            $accounts = $this->authentication->login();
            $allAccounts = $accounts->getLoginAccounts();
            $account = $allAccounts[0];
            $this->account_id = $account->getAccountId();
        }

        $this->authenticated = true;

        return $this;
    }
public function authenticate ( ) { if ( ! isset ( $ this -> account_id ) ) { $ accounts = $ this -> authentication -> login ( ) ; $ allAccounts = $ accounts -> getLoginAccounts ( ) ; $ account = $ allAccounts [ 0 ] ; $ this -> account_id = $ account -> getAccountId ( ) ; } $ this -> authenticated = true ; return $ this ; }
Authenticates api client and stores account_id

@return $this
Authenticates api client and stores account_id