public function __construct(ManagerRegistry $registry, $basepath, $dataDir) { $this->dm = $registry->getManager(); $this->session = $registry->getConnection(); $this->basepath = $basepath; $this->dataDir = $dataDir; }
/** * @param ManagerRegistry $registry */ public function init(ManagerRegistry $registry) { $documentManager = $registry->getManager(); if ($documentManager->find(null, $this->basePath)) { return; } $homepage = new Homepage(); $homepage->setName($this->basePath); $documentManager->persist($homepage); $documentManager->flush(); $session = $registry->getConnection(); // Create Fixtures NodeHelper::createPath($session, $this->basePath . '/fixtures/routes'); $session->save(); }
public function init(ManagerRegistry $registry) { $dm = $registry->getManager(); if ($dm->find(null, $this->basePath)) { return; } $site = new Site(); $site->setId($this->basePath); $dm->persist($site); $dm->flush(); $session = $registry->getConnection(); // create the 'cms', 'pages', and 'posts' nodes NodeHelper::createPath($session, $this->basePath . '/pages'); NodeHelper::createPath($session, $this->basePath . '/posts'); NodeHelper::createPath($session, $this->basePath . '/routes'); $session->save(); }
/** * This method should be used to establish the requisite * structure needed by the application or bundle of the * content repository. * * @param ManagerRegistry $registry */ public function init(ManagerRegistry $registry) { $documentManager = $registry->getManager(); if ($documentManager->find(null, $this->basePath)) { return; } $site = new Site(); $site->setId($this->basePath); $documentManager->persist($site); $documentManager->flush(); $session = $registry->getConnection(); NodeHelper::createPath($session, $this->basePath . '/articles'); NodeHelper::createPath($session, $this->basePath . '/events'); NodeHelper::createPath($session, $this->basePath . '/pages'); NodeHelper::createPath($session, $this->basePath . '/posts'); NodeHelper::createPath($session, $this->basePath . '/routes'); $session->save(); }