/** * @Route("/", name="homepage") */ public function indexAction(Request $request) { $bp = new BlogPost(); $bp->setTitle("test title"); $bp->setCreatedAt(new \DateTime()); $dm = $this->get('doctrine_mongodb')->getManager(); $dm->persist($bp); $dm->flush(); // replace this example code with whatever you need return $this->render('default/index.html.twig', ['base_dir' => realpath($this->container->getParameter('kernel.root_dir') . '/..')]); }
/** * {@inheritDoc} */ public function getCreatedAt() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getCreatedAt', []); return parent::getCreatedAt(); }