/** * @return bool */ public function afterSave() { $new_thread = $this->object->get('thread'); if ($this->old_thread != $new_thread) { $this->object->changeThread($this->old_thread, $new_thread); } else { $this->object->clearTicketCache(); } return parent::afterSave(); }
/** * @return bool */ public function afterSave() { if ($this->object->get('published')) { $this->thread->fromArray(array('comment_last' => $this->object->get('id'), 'comment_time' => $this->object->get('createdon'))); $this->thread->save(); } if ($this->guest) { if (!isset($_SESSION['TicketComments'])) { $_SESSION['TicketComments'] = array('ids' => array()); } $_SESSION['TicketComments']['name'] = $this->object->get('name'); $_SESSION['TicketComments']['email'] = $this->object->get('email'); $_SESSION['TicketComments']['ids'][$this->object->get('id')] = 1; } $this->thread->updateCommentsCount(); $this->object->clearTicketCache(); return parent::afterSave(); }
/** * @return bool */ public function beforeSave() { $this->object->fromArray(array('editedon' => time(), 'editedby' => $this->modx->user->isAuthenticated($this->modx->context->key) ? $this->modx->user->id : 0)); if ($this->guest) { $_SESSION['TicketComments']['name'] = $this->object->get('name'); $_SESSION['TicketComments']['email'] = $this->object->get('email'); } return parent::beforeSave(); }
/** * */ public function logManagerAction() { $this->modx->logManagerAction($this->objectType . '_undelete', $this->classKey, $this->object->get($this->primaryKeyField)); }
/** * @param string $action */ public function logManagerAction($action = '') { $this->modx->logManagerAction($this->objectType . '_unpublish', $this->classKey, $this->object->get($this->primaryKeyField)); }