getUser() ; if($user) { $form = $this->createForm(SwitchMerchantFormType::class); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $merchant = $form->get('merchant')->getData(); if ($merchant) { $user->setFavoriteMerchant($merchant) ; $entityManager->update($user) ; $entityManager->flush() ; // @TODO : à fignoler, hein gamin ? $url = $merchant->getSettingValue(MerchantSettingDefinition::SETTING_URL).'admin'; if ($url) { return $this->redirect($url); } } } } } }