protected function Init() { $this->settings = SettingsProxy::Singleton()->Settings(); $this->AddLogLifetimeField(); $this->AddMailFromEMailField(); $this->AddMailFromNameField(); $this->AddSmtpHostField(); $this->AddSmtpPortField(); $this->AddSmtpUserField(); $this->AddSmtpPasswordField(); $this->AddSmtpSecurityField(); $this->AddSubmit(); return parent::Init(); }
/** * Deletes log items older then the given amount of days * @param int $days The days */ private function DeleteOldLogItems() { $days = SettingsProxy::Singleton()->Settings()->GetLogLifetime(); $deleteBefore = Date::Now(); $deleteBefore->AddDays(-$days); $tblLogItem = LogItem::Schema()->Table(); $sql = Access::SqlBuilder(); $where = $sql->LT($tblLogItem->Field('Changed'), $sql->Value($deleteBefore)); LogItem::Schema()->Delete($where); }