/** * @param Psc\Entities\Page $page */ public function setPage(Page $page = NULL) { $this->page = $page; if (isset($page)) { $page->addNavigationNode($this); } return $this; }
protected function insertPageWithLocaleContentStreams() { $page = new Page('test-page'); foreach ($this->languages as $lang) { foreach (array('page-content', 'sidebar-content') as $type) { $cs = ContentStream::create($lang, $type, 'default', 'cs-' . $type . '-' . $lang); $page->addContentStream($cs); $this->em->persist($cs); } } $this->em->persist($page); $this->em->flush(); $this->em->clear(); return $page; }