Ejemplo n.º 1
1
 /**
  * @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();
 }
Ejemplo n.º 2
0
 /**
  * @return bool
  */
 public function afterSave()
 {
     $this->object->clearTicketCache();
     /* @var TicketThread $thread */
     if ($thread = $this->object->getOne('Thread')) {
         $thread->updateLastComment();
     }
     $this->modx->cacheManager->delete('tickets/latest.comments');
     $this->modx->cacheManager->delete('tickets/latest.tickets');
     return parent::afterSave();
 }
Ejemplo n.º 3
0
 /**
  * @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();
 }
Ejemplo n.º 4
0
 /**
  * @return bool
  */
 public function afterSave()
 {
     $this->object->clearTicketCache();
     return parent::afterSave();
 }