Symfony flush不起作用

时间:2018-05-13 04:38:17

标签: symfony doctrine flush

冲洗功能在特定功能中不起作用。这是它无法正常工作的功能:

 /**
   * @Route("/mob/user/ma")
   */
  public function setMaAction(Request $request)
  {
    $em = $this->getDoctrine()->getManager();

    $user = $em->getRepository('AppBundle:User')->find(1);


    $date = $trainer->getDate();
    $date->modify('+30 day');
    $user->setDate($date);

//dump($user->getDate()); ===> return date 30 days after today! correct...
    $em->persist($user);
    $em->flush();

    return new Response("A");
  }

0 个答案:

没有答案