/**
  * @Method({"POST"})
  * @Route(
  *      "/reader_currency_send",
  *      name="reader_currency_send",
  *      host="{_locale}.{domain}",
  *      defaults={"_locale" = "%locale%", "domain" = "%domain%"},
  *      requirements={"_locale" = "%locale%|en", "domain" = "%domain%"}
  * )
  * @Route(
  *      "/reader_currency_send",
  *      name="reader_currency_send_default",
  *      host="{domain}",
  *      defaults={"_locale" = "%locale%", "domain" = "%domain%"},
  *      requirements={"domain" = "%domain%"}
  * )
  */
 public function sendReaderCurrencyAction(Request $request)
 {
     $form = $this->createForm(new ReaderCurrencyType(), $readerCurrency = new ReaderCurrency());
     $form->handleRequest($request);
     if (!$form->isValid()) {
         $message = ['error' => $this->stringifyFormErrors($form)];
     } else {
         $_manager = $this->getDoctrine()->getManager();
         $_translator = $this->get('translator');
         $this->getUser()->setPreferredCurrency($readerCurrency->getPreferredCurrency());
         $_manager->persist($this->getUser());
         $_manager->flush();
         $message = ['notification' => $_translator->trans("private_office.reader_currency.success", [], 'responses')];
     }
     $this->get('session')->getFlashBag()->add(self::MESSAGE_READER_CURRENCY, $message);
     return $this->redirectToRoute('private_office', ['_locale' => $request->getLocale()]);
 }