/** * Get the data */ protected function getData() { $this->item = BackendAgendaModel::get($this->itemId); $this->image = BackendAgendaModel::getImage($this->id); $this->image['data'] = unserialize($this->record['data']); $this->image['link'] = $this->record['data']['link']; }
/** * Load the item data */ protected function loadData() { $this->id = $this->getParameter('id', 'int', null); if ($this->id == null || !BackendAgendaModel::exists($this->id)) { $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing'); } $this->record = BackendAgendaModel::get($this->id); // get recurring options if ($this->record['recurring'] == 'Y') { $this->recurringOptions = BackendAgendaModel::getRecurringOptions($this->record['id']); $this->recurringOptionsDays = explode(",", $this->recurringOptions['days']); } }
/** * Execute the action */ public function execute() { $this->id = $this->getParameter('id', 'int'); // does the item exist if ($this->id !== null && BackendAgendaModel::exists($this->id)) { parent::execute(); $this->record = (array) BackendAgendaModel::get($this->id); BackendAgendaModel::delete($this->id); BackendModel::triggerEvent($this->getModule(), 'after_delete', array('id' => $this->id)); $this->redirect(BackendModel::createURLForAction('index') . '&report=deleted&var=' . urlencode($this->record['title'])); } else { $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing'); } }
/** * Get the necessary data */ private function getData() { $this->item = BackendAgendaModel::get($this->getParameter('agenda_id', 'int')); }
/** * Gets all necessary data */ protected function getData() { $this->item = BackendAgendaModel::get($this->id); }