/** * @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; }
function SessionGC($time) { return $this->_dbConnection->Execute($this->_commandCreator->SessionGC($time)); }