Esempio n. 1
0
 /**
  * @param Account $account
  * @param Array $arrayEmails
  * @return bool
  */
 function UpdateSuggestTable(&$account, $arrayEmailsWithFName)
 {
     $arrayEmails = array_keys($arrayEmailsWithFName);
     $DBEmails = $this->SelectExistEmails($account, $arrayEmails);
     if ($DBEmails === false) {
         return false;
     }
     $arrayEmails = array_unique($arrayEmails);
     $DBEmails = array_unique($DBEmails);
     $NewEmails = array_diff($arrayEmails, $DBEmails);
     $UpdateEmails = $arrayEmails;
     if (count($UpdateEmails) > 0) {
         if (!$this->_dbConnection->Execute($this->_commandCreator->UpdateContactFrequencyByEmail($account, $UpdateEmails))) {
             return false;
         }
     }
     if (count($NewEmails) > 0) {
         foreach ($NewEmails as $key) {
             if (strlen($key) > 0) {
                 //$arrayEmailsWithFName[$key]
                 if (!$this->_dbConnection->Execute($this->_commandCreator->InsertAutoCreateContact($account, $key, $arrayEmailsWithFName[$key]))) {
                     return false;
                 }
             }
         }
     }
     return true;
 }
Esempio n. 2
0
 function DeleteSubAdminsByIds($subAdminsIds)
 {
     if (is_array($subAdminsIds) && count($subAdminsIds) > 0) {
         foreach ($subAdminsIds as $subAdminId) {
             $this->_connector->Execute($this->_commandCreator->ClearSubAdminDomains($subAdminId));
             $this->_connector->Execute($this->_commandCreator->DeleteSubAdminById($subAdminId));
         }
         return true;
     }
     return false;
 }
Esempio n. 3
0
 /**
  * @param	string	$pref
  * @return	bool
  */
 function CreateTables($pref)
 {
     $tableArray = GetTablesArray($pref);
     $original = GetTablesArray('');
     foreach ($tableArray as $key => $tname) {
         $sql = trim($this->_commandCreator->CreateTable($original[$key], $pref));
         if ($sql === '') {
             return false;
         }
         if (!$this->_connector->Execute($sql)) {
             return $tname;
         }
     }
     return true;
 }
Esempio n. 4
0
 function SessionGC($time)
 {
     return $this->_dbConnection->Execute($this->_commandCreator->SessionGC($time));
 }