$producer = $this->getProducerContainer()->getRepository()->findOneProducerById($id); | $producer = $this->getProducerContainer()->getRepository()->findOneProducerById($id); | ||||
if($producer) { | if($producer) { | ||||
$this->getUserModule()->getServices()->getBuilder()->switchProducer($user, $producer); | |||||
$this->getUserModule()->getBuilder()->switchProducer($user, $producer); | |||||
} | } | ||||
else { | else { | ||||
$this->addFlash('error', 'Producteur introuvable.'); | $this->addFlash('error', 'Producteur introuvable.'); |