Пример #1
0
 /**
  * Returns domain identifier for primary user account. The method is especially useful in case
  * if your product configuration allows for adding multiple accounts per user. 
  * 
  * @param int $iUserId WebMail Pro user identifier (not to be confused with account ID).
  * 
  * @return int
  */
 public function getDefaultAccountDomainId($iUserId)
 {
     $iResult = -1;
     if ($this->oConnection->Execute($this->oCommandCreator->getDefaultAccountDomainIdQuery($iUserId))) {
         $oRow = $this->oConnection->GetNextRecord();
         if ($oRow) {
             $iResult = (int) $oRow->id_domain;
             if (1 > $iResult) {
                 $iResult = -1;
             }
         }
         $this->oConnection->FreeResult();
     }
     return $iResult;
 }