public function __construct(ManagerRegistry $registry, $basepath, $dataDir) { $this->dm = $registry->getManager(); $this->session = $registry->getConnection(); $this->basepath = $basepath; $this->dataDir = $dataDir; }
/** * {@inheritDoc} */ public function init(ManagerRegistry $registry) { $session = $registry->getConnection(); if ($this->cnd) { $this->registerCnd($session, $this->cnd); } if (count($this->basePaths)) { $this->createBasePaths($session, $this->basePaths); } }
/** * {@inheritdoc} */ public function init(ManagerRegistry $registry) { /** @var SessionInterface $session */ $session = $registry->getConnection(); /** @var Query $tenantsQuery */ $tenantsQuery = $this->tenantProvider->getAvailableTenants(); /** @var Collection $tenants */ $tenants = $tenantsQuery->getResult(); $this->generateBasePaths($session, $tenants->toArray()); }
/** * @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(); }
public function __construct(ManagerRegistry $manager, $sessionName) { $this->session = $manager->getConnection($sessionName); }