/** * @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(); }
/** * */ protected function sendCommentMails() { /** @var TicketThread $thread */ if ($thread = $this->object->getOne('Thread')) { /** @var Tickets $Tickets */ if ($Tickets = $this->modx->getService('Tickets')) { $Tickets->config = $thread->get('properties'); $Tickets->sendCommentMails($this->object->toArray()); } } }