/** * {@inheritDoc} */ public function load(ObjectManager $manager) { $template = new Template(); $template->setObjectClass('Opifer\\CmsBundle\\Entity\\Content'); $template->setName('page'); $template->setDisplayName('Page'); $presentation = '{"id":' . $this->getReference("page-layout")->getId() . ',"name":"page", "filename":"OpiferCmsBundle:Layout:page.html.twig"}'; $presentation = json_encode(json_decode($presentation, true)); $template->setPresentation($presentation); $manager->persist($template); $this->addReference('page-template', $template); $manager->flush(); }