本文整理汇总了PHP中TYPO3\TYPO3CR\Domain\Repository\WorkspaceRepository::removeAll方法的典型用法代码示例。如果您正苦于以下问题:PHP WorkspaceRepository::removeAll方法的具体用法?PHP WorkspaceRepository::removeAll怎么用?PHP WorkspaceRepository::removeAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\TYPO3CR\Domain\Repository\WorkspaceRepository
的用法示例。
在下文中一共展示了WorkspaceRepository::removeAll方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pruneAll
/**
* Remove all nodes, workspaces, domains and sites.
*
* @return void
*/
public function pruneAll()
{
$sites = $this->siteRepository->findAll();
$this->nodeDataRepository->removeAll();
$this->workspaceRepository->removeAll();
$this->domainRepository->removeAll();
$this->siteRepository->removeAll();
foreach ($sites as $site) {
$this->emitSitePruned($site);
}
}
示例2: importSite
/**
* @param \TYPO3\Form\Core\Model\FinisherContext $finisherContext
* @return void
* @throws \TYPO3\Setup\Exception
*/
public function importSite(\TYPO3\Form\Core\Model\FinisherContext $finisherContext)
{
$formValues = $finisherContext->getFormRuntime()->getFormState()->getFormValues();
if (isset($formValues['prune']) && intval($formValues['prune']) === 1) {
$this->nodeDataRepository->removeAll();
$this->workspaceRepository->removeAll();
$this->domainRepository->removeAll();
$this->siteRepository->removeAll();
$this->persistenceManager->persistAll();
}
if (!empty($formValues['packageKey'])) {
if ($this->packageManager->isPackageAvailable($formValues['packageKey'])) {
throw new \TYPO3\Setup\Exception(sprintf('The package key "%s" already exists.', $formValues['packageKey']), 1346759486);
}
$packageKey = $formValues['packageKey'];
$siteName = $formValues['siteName'];
$generatorService = $this->objectManager->get('TYPO3\\Neos\\Kickstarter\\Service\\GeneratorService');
$generatorService->generateSitePackage($packageKey, $siteName);
} elseif (!empty($formValues['site'])) {
$packageKey = $formValues['site'];
}
$this->deactivateOtherSitePackages($packageKey);
$this->packageManager->activatePackage($packageKey);
if (!empty($packageKey)) {
try {
$contentContext = $this->contextFactory->create(array('workspaceName' => 'live'));
$this->siteImportService->importFromPackage($packageKey, $contentContext);
} catch (\Exception $exception) {
$finisherContext->cancel();
$this->systemLogger->logException($exception);
throw new SetupException(sprintf('Error: During the import of the "Sites.xml" from the package "%s" an exception occurred: %s', $packageKey, $exception->getMessage()), 1351000864);
}
}
}
示例3: importSite
/**
* @param \TYPO3\Form\Core\Model\FinisherContext $finisherContext
* @return void
* @throws \TYPO3\Setup\Exception
*/
public function importSite(\TYPO3\Form\Core\Model\FinisherContext $finisherContext)
{
$formValues = $finisherContext->getFormRuntime()->getFormState()->getFormValues();
if (isset($formValues['prune']) && intval($formValues['prune']) === 1) {
$this->nodeRepository->removeAll();
$this->workspaceRepository->removeAll();
$this->domainRepository->removeAll();
$this->siteRepository->removeAll();
$this->persistenceManager->persistAll();
}
if (!empty($formValues['packageKey'])) {
if ($this->packageManager->isPackageAvailable($formValues['packageKey'])) {
throw new \TYPO3\Setup\Exception(sprintf('The package key "%s" already exists.', $formValues['packageKey']), 1346759486);
}
$packageKey = $formValues['packageKey'];
$siteName = $formValues['packageKey'];
$this->packageManager->createPackage($packageKey, NULL, Files::getUnixStylePath(Files::concatenatePaths(array(FLOW3_PATH_PACKAGES, 'Sites'))));
$this->generatorService->generateSitesXml($packageKey, $siteName);
$this->generatorService->generateSitesTypoScript($packageKey, $siteName);
$this->generatorService->generateSitesTemplate($packageKey, $siteName);
$this->packageManager->activatePackage($packageKey);
} else {
$packageKey = $formValues['site'];
}
if ($packageKey !== '') {
try {
$contentContext = new \TYPO3\TYPO3\Domain\Service\ContentContext('live');
$this->nodeRepository->setContext($contentContext);
$this->siteImportService->importFromPackage($packageKey);
} catch (\Exception $exception) {
$finisherContext->cancel();
$this->flashMessageContainer->addMessage(new \TYPO3\FLOW3\Error\Error(sprintf('Error: During the import of the "Sites.xml" from the package "%s" an exception occurred: %s', $packageKey, $exception->getMessage())));
}
}
}
示例4: aSingleNodeExportedWithNodeDataExportCanBeImportedWithNodeDataImport
/**
* @test
*/
public function aSingleNodeExportedWithNodeDataExportCanBeImportedWithNodeDataImport()
{
$originalNode = $this->rootNode->createNode('foo', $this->nodeTypeManager->getNodeType('TYPO3.TYPO3CR.Testing:ImportExport'));
$originalNode->setProperty('description', 'Some node with a property');
$originalNode->setProperty('someDate', new \DateTime());
$this->persistenceManager->persistAll();
$exportService = new NodeExportService();
$xml = $exportService->export('/')->outputMemory();
$this->nodeDataRepository->removeAll();
$this->workspaceRepository->removeAll();
$this->saveNodesAndTearDownRootNodeAndRepository();
$this->setUpRootNodeAndRepository();
$importService = new NodeImportService();
$reader = new \XMLReader();
$reader->XML($xml);
$importService->import($reader, '/');
$importedNode = $this->rootNode->getNode('foo');
$this->assertNotNull($importedNode, 'Expected node not found');
$this->assertSame($originalNode->getIdentifier(), $importedNode->getIdentifier());
$this->assertSame($originalNode->getProperty('description'), $importedNode->getProperty('description'));
$this->assertEquals($originalNode->getProperty('someDate'), $importedNode->getProperty('someDate'));
}
示例5: pruneCommand
/**
* Remove all content and related data - for now. In the future we need some more sophisticated cleanup.
*
* @param boolean $confirmation
* @return void
*/
public function pruneCommand($confirmation = FALSE)
{
if ($confirmation === FALSE) {
$this->outputLine('Please confirm that you really want to remove all sites and content from the database.');
$this->outputLine('');
$this->outputLine('Syntax:');
$this->outputLine(' ./flow3 site:prune --confirmation TRUE');
$this->quit(1);
}
$this->nodeRepository->removeAll();
$this->workspaceRepository->removeAll();
$this->domainRepository->removeAll();
$this->siteRepository->removeAll();
$this->outputLine('All sites and content have been removed.');
}
示例6: pruneCommand
/**
* Remove all nodes, workspaces, domains and sites.
*
* @param boolean $confirmation
* @return void
*/
public function pruneCommand($confirmation = FALSE)
{
if ($confirmation === FALSE) {
$this->outputLine('Please confirm that you really want to remove all content from the database.');
$this->outputLine('');
$this->outputLine('Syntax:');
$this->outputLine(' ./flow facets:prune --confirmation TRUE');
exit;
}
$this->nodeDataRepository->removeAll();
$this->workspaceRepository->removeAll();
$this->domainRepository->removeAll();
$this->siteRepository->removeAll();
$this->outputLine('Database cleared');
}