Exemplo n.º 1
0
 /**
  * Make sure that the transaction is always SOMEHOW closed at the end of the request.
  * 
  * @param FilterResponseEvent $event
  */
 public function onKernelResponse(FilterResponseEvent $event)
 {
     if ($event->isMasterRequest()) {
         $this->transaction->closeTransaction();
     }
     if ($event->getRequest()->getSession()->has('_locale')) {
         $event->getResponse()->headers->setCookie(new Cookie(self::LAST_LANG_COOKIE, $event->getRequest()->getSession()->get('_locale'), time() + self::DEF_LAST_LANG_TIME));
     }
 }