public function populate($data) { $success = parent::populate($data); $success = $success && ($this->Subject = AppModel::FindById($this->subject_class, $this->subject_id, false)) != false; if ($this->object_class) { if ($this->object_id > 0) { $success = $success && ($this->Object = AppModel::FindById($this->object_class, $this->object_id, false)) != false; } else { $this->Object = new StringEvent($this->object_class); $this->object_class = $this->Object->class; } } $this->action_full = defined($constant = 'EVENT_' . strtoupper($this->action)) ? constant($constant) : null; return $success; }
public function admin_remove($id) { // load $this->Model = AppModel::FindById(Url::$data['modelName'], $id, true); // destroy if ($success = $this->Model->destroy(true)) { // redirect $this->redirect(DS . ADMIN_ROUTE . DS . Url::$data['controller'], false); } }