Пример #1
0
 /**
  * @Route("/assocation_test", name="front")
  *
  * @param Request $request
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function indexAction(Request $request)
 {
     $this->entityManager = $this->getDoctrine()->getManager('customer1');
     $objects = $this->entityManager->getRepository('AppBundle:Product')->findBy(array('productId' => 1));
     if ($objects) {
         $this->object = $objects[0];
     } else {
         $this->object = new Product();
         $this->object->setOuterId(1);
     }
     $this->setObjects();
     $this->saveObjects();
     return $this->render('CronBundle::message.html.twig', array('message' => '...'));
 }