Ejemplo n.º 1
0
 /**
  * Change a message
  *
  * @param \Thelia\Core\Event\Message\MessageUpdateEvent $event
  */
 public function modify(MessageUpdateEvent $event)
 {
     if (null !== ($message = MessageQuery::create()->findPk($event->getMessageId()))) {
         $message->setDispatcher($event->getDispatcher())->setName($event->getMessageName())->setSecured($event->getSecured())->setLocale($event->getLocale())->setTitle($event->getTitle())->setSubject($event->getSubject())->setHtmlMessage($event->getHtmlMessage())->setTextMessage($event->getTextMessage())->setHtmlLayoutFileName($event->getHtmlLayoutFileName())->setHtmlTemplateFileName($event->getHtmlTemplateFileName())->setTextLayoutFileName($event->getTextLayoutFileName())->setTextTemplateFileName($event->getTextTemplateFileName())->save();
         $event->setMessage($message);
     }
 }