/** * @param string $sAuthToken = '' * @return \CAccount | null */ public function GetDefaultAccount($sAuthToken = '') { $oResult = null; $iUserId = $this->oApiIntegrator->getLogginedUserId($sAuthToken); if (0 < $iUserId) { $iAccountId = $this->oApiUsers->getDefaultAccountId($iUserId); if (0 < $iAccountId) { $oAccount = $this->oApiUsers->getAccountById($iAccountId); if ($oAccount instanceof \CAccount && !$oAccount->IsDisabled) { $oResult = $oAccount; } } } return $oResult; }