Пример #1
0
 /**
  * @param CAccount $oAccount
  * @param $sAuthType
  * @param $iDataType
  * @param $sDataValue
  * @return bool
  * @throws CApiBaseException
  */
 public function CreateAccount(\CAccount &$oAccount, $sAuthType, $iDataType, $sDataValue)
 {
     $bResult = false;
     $oObject = new CTwofactorauth();
     $oObject->AccountId = $oAccount->IdAccount;
     $oObject->AuthType = $sAuthType;
     $oObject->DataType = $iDataType;
     $oObject->DataValue = $sDataValue;
     if ($this->oConnection->Execute($this->oCommandCreator->CreateAccount($oObject))) {
         $oAccount->Id = $this->oConnection->GetLastInsertId('twofa_accounts', 'id');
         $bResult = true;
     }
     $this->throwDbExceptionIfExist();
     return $bResult;
 }