Пример #1
0
 /**
  * Retrieves information on particular WebMail Pro user. 
  * 
  * @param int $iUserId User identifier.
  * @param CDomain $oDomain
  * 
  * @return CUser | false
  */
 public function getUserById($iUserId, $oDomain = null)
 {
     $oUser = false;
     if ($this->oConnection->Execute($this->oCommandCreator->getUserByIdQuery($iUserId))) {
         $oUser = null;
         $oRow = $this->oConnection->GetNextRecord();
         if ($oRow) {
             if (null === $oDomain) {
                 /* @var $oApiDomainsManager CApiDomainsManager */
                 $oApiDomainsManager = CApi::Manager('domains');
                 $oDomain = $oApiDomainsManager->getDefaultDomain();
             }
             $oUser = new CUser($oDomain);
             $oUser->InitByDbRow($oRow);
         }
         $this->oConnection->FreeResult();
     }
     $this->throwDbExceptionIfExist();
     return $oUser;
 }