Пример #1
0
 /**
  * Create a new template entry
  *
  * @param \Thelia\Core\Event\Template\TemplateCreateEvent $event
  */
 public function create(TemplateCreateEvent $event)
 {
     $template = new TemplateModel();
     $template->setDispatcher($event->getDispatcher())->setLocale($event->getLocale())->setName($event->getTemplateName())->save();
     $event->setTemplate($template);
 }
Пример #2
0
 /**
  * Create a new template entry
  *
  * @param \Thelia\Core\Event\Template\TemplateCreateEvent $event
  * @param $eventName
  * @param EventDispatcherInterface $dispatcher
  */
 public function create(TemplateCreateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
 {
     $template = new TemplateModel();
     $template->setDispatcher($dispatcher)->setLocale($event->getLocale())->setName($event->getTemplateName())->save();
     $event->setTemplate($template);
 }