コード例 #1
0
 /**
  * Handle on add comment event
  *
  * @param array $files Attached files
  * @return null
  */
 function onAttachFiles($files)
 {
     try {
         $this->setUpdated('attachment');
         $this->save();
         foreach ($files as $file) {
             $change = new ProjectTicketChange();
             $change->setTicketId($this->getId());
             $change->setType('attachment');
             $change->setToData($file->getFilename());
             $change->save();
         }
         // foreach
         Notifier::attachFilesToTicket($this, $files);
     } catch (Exception $e) {
         // nothing here, just suppress error...
     }
     // try
 }