/** * @param int $iIdAccount * @return array */ public function GetAccounts($iIdAccount) { $aAccounts = array(); if ($this->oConnection->Execute($this->oCommandCreator->GetAccounts((int) $iIdAccount))) { $oRow = null; while (false !== ($oRow = $this->oConnection->GetNextRecord())) { $oAccount = new \CTwofactorauth(); $oAccount->InitByDbRow($oRow); $aAccounts[] = $oAccount; } } $this->throwDbExceptionIfExist(); return $aAccounts; }
/** * @param string $sWhere * @return string */ protected function getAccountByWhere($sWhere) { $aMap = api_AContainer::DbReadKeys(CTwofactorauth::getStaticMap()); $aMap = array_map(array($this, 'escapeColumn'), $aMap); $sSql = 'SELECT %s FROM %stwofa_accounts WHERE %s'; return sprintf($sSql, implode(', ', $aMap), $this->prefix(), $sWhere); }