芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/www/midiatech/lib/Entity/ScheduleReminder.php
setCommonDependencies($store, $log); $this->config = $config; $this->scheduleReminderFactory = $scheduleReminderFactory; } /** * Add */ private function add() { $this->scheduleReminderId = $this->getStore()->insert(' INSERT INTO `schedulereminder` (`eventId`, `value`, `type`, `option`, `reminderDt`, `isEmail`, `lastReminderDt`) VALUES (:eventId, :value, :type, :option, :reminderDt, :isEmail, :lastReminderDt) ', [ 'eventId' => $this->eventId, 'value' => $this->value, 'type' => $this->type, 'option' => $this->option, 'reminderDt' => $this->reminderDt, 'isEmail' => $this->isEmail, 'lastReminderDt' => $this->lastReminderDt, ]); } /** * Edit */ private function edit() { $sql = ' UPDATE `schedulereminder` SET `eventId` = :eventId, `type` = :type, `value` = :value, `option` = :option, `reminderDt` = :reminderDt, `isEmail` = :isEmail, `lastReminderDt` = :lastReminderDt WHERE scheduleReminderId = :scheduleReminderId '; $params = [ 'eventId' => $this->eventId, 'type' => $this->type, 'value' => $this->value, 'option' => $this->option, 'reminderDt' => $this->reminderDt, 'isEmail' => $this->isEmail, 'lastReminderDt' => $this->lastReminderDt, 'scheduleReminderId' => $this->scheduleReminderId, ]; $this->getStore()->update($sql, $params); } /** * Delete * @throws XiboException */ public function delete() { $this->load(); $this->getLog()->debug('Delete schedule reminder: '.$this->scheduleReminderId); $this->getStore()->update('DELETE FROM `schedulereminder` WHERE `scheduleReminderId` = :scheduleReminderId', [ 'scheduleReminderId' => $this->scheduleReminderId ]); } /** * Load */ public function load() { if ($this->loaded || $this->scheduleReminderId == null) return; $this->loaded = true; } /** * Get Id * @return int */ public function getId() { return $this->scheduleReminderId; } /** * Get Reminder Date * @return int */ public function getReminderDt() { return $this->reminderDt; } /** * Save */ public function save() { if ($this->scheduleReminderId == null || $this->scheduleReminderId == 0) $this->add(); else $this->edit(); } }