1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
$courriers = array('courriers' => $em->getRepository('WebscmServiceBundle:Courrier')->getCourrierCom());
$form = $this->createForm(new TotalCourrierCommandeType, $courriers);
$request = $this->getRequest();
$form->bindRequest($request);
if ($form->isValid())
{
// throw $this->createNotFoundException('Jusque là: OK');
foreach($courriers as $c)
{
$c->setDateCourrierCommande(date("Y-m-d H:i:s"));
$em->persist($c);
}
$em->flush();
$this->get('session')->setFlash('notice', 'Les courriers AR Commandes ont bien été enregistrés.');
return $this->redirect($this->generateUrl('WebscmServiceBundle_Courrier_index'));
}
// $this->get('session')->setFlash('notice', 'Une erreur s\'est produite lors de l\'enregistrement des courriers.');
// return $this->redirect($this->generateUrl('WebscmServiceBundle_Courrier_index'));
throw $this->createNotFoundException(); |
Partager