/**
  * Let's process transaction
  *
  * @param GetResponseForControllerResultEvent $event event
  *
  * @return void
  */
 public function onKernelView(GetResponseForControllerResultEvent $event)
 {
     $request = $event->getRequest();
     $view = $event->getControllerResult();
     if (!$view instanceof View) {
         return;
     }
     $transaction = $request->get('transaction');
     if ($transaction instanceof Transaction) {
         $data = $view->getData();
         $violations = $request->get('violations');
         $view->setData($this->transactionResponseManager->handle($transaction, $data, $violations));
         $view->setStatusCode($transaction->getStatus());
     }
 }
 /**
  * Let's process transaction
  *
  * @param GetResponseForControllerResultEvent $event event
  *
  * @return void
  */
 public function onKernelView(GetResponseForControllerResultEvent $event)
 {
     $request = $event->getRequest();
     $view = $event->getControllerResult();
     if (!$view instanceof View) {
         return;
     }
     $transaction = $request->get('transaction');
     if ($transaction instanceof Transaction) {
         $data = $view->getData();
         $violations = $request->get('violations');
         $view->setData($this->transactionResponseManager->handle($transaction, $data, $violations));
         if (!$transaction->getSuccess()) {
             $request->attributes->set(EmbeddedManager::KEY_EMBED, EmbeddedManager::GROUP_ALL);
         }
     }
 }