本文整理汇总了PHP中TYPO3\TYPO3CR\Domain\Repository\WorkspaceRepository::add方法的典型用法代码示例。如果您正苦于以下问题:PHP WorkspaceRepository::add方法的具体用法?PHP WorkspaceRepository::add怎么用?PHP WorkspaceRepository::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\TYPO3CR\Domain\Repository\WorkspaceRepository
的用法示例。
在下文中一共展示了WorkspaceRepository::add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createAction
/**
* Shows details of the given workspace
*
* @param string $workspaceName
* @param Workspace $baseWorkspace
* @return string
*/
public function createAction($workspaceName, Workspace $baseWorkspace)
{
$existingWorkspace = $this->workspaceRepository->findByIdentifier($workspaceName);
if ($existingWorkspace !== NULL) {
$this->throwStatus(409, 'Workspace already exists', '');
}
$workspace = new Workspace($workspaceName, $baseWorkspace);
$this->workspaceRepository->add($workspace);
$this->throwStatus(201, 'Workspace created', '');
}
示例2: nodePathAvailableForNodeWillReturnFalseIfNodeWithGivenPathExistsAlready
/**
* @test
*/
public function nodePathAvailableForNodeWillReturnFalseIfNodeWithGivenPathExistsAlready()
{
$this->workspaceRepository->add(new \TYPO3\TYPO3CR\Domain\Model\Workspace('live'));
$rootNode = $this->context->getRootNode();
$fooNode = $rootNode->createNode('foo');
$fooNode->createNode('bar');
$bazNode = $rootNode->createNode('baz');
$this->persistenceManager->persistAll();
$actualResult = $this->nodeService->nodePathAvailableForNode('/foo/bar', $bazNode);
$this->assertFalse($actualResult);
}
示例3: setUp
/**
* @return void
*/
public function setUp()
{
parent::setUp();
$this->nodeTypeManager = $this->objectManager->get(\TYPO3\TYPO3CR\Domain\Service\NodeTypeManager::class);
$this->liveWorkspace = new Workspace('live');
$this->workspaceRepository = $this->objectManager->get(\TYPO3\TYPO3CR\Domain\Repository\WorkspaceRepository::class);
$this->workspaceRepository->add($this->liveWorkspace);
$this->persistenceManager->persistAll();
$this->contextFactory = $this->objectManager->get(\TYPO3\TYPO3CR\Domain\Service\ContextFactoryInterface::class);
$this->context = $this->contextFactory->create(['workspaceName' => 'live']);
$this->nodeDataRepository = $this->objectManager->get(\TYPO3\TYPO3CR\Domain\Repository\NodeDataRepository::class);
}
示例4: setUp
/**
* @return void
*/
public function setUp()
{
parent::setUp();
$this->nodeTypeManager = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Service\\NodeTypeManager');
$this->liveWorkspace = new Workspace('live');
$this->workspaceRepository = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Repository\\WorkspaceRepository');
$this->workspaceRepository->add($this->liveWorkspace);
$this->persistenceManager->persistAll();
$this->contextFactory = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Service\\ContextFactoryInterface');
$this->context = $this->contextFactory->create(array('workspaceName' => 'live'));
$this->nodeDataRepository = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Repository\\NodeDataRepository');
}
示例5: setUpRootNodeAndRepository
protected function setUpRootNodeAndRepository()
{
$this->contextFactory = $this->objectManager->get(ContextFactory::class);
$personalContext = $this->contextFactory->create(array('workspaceName' => $this->currentTestWorkspaceName));
$this->workspaceRepository = $this->objectManager->get(WorkspaceRepository::class);
if ($this->liveWorkspace === null) {
$this->liveWorkspace = new Workspace('live');
$this->workspaceRepository->add($this->liveWorkspace);
$this->workspaceRepository->add(new Workspace($this->currentTestWorkspaceName, $this->liveWorkspace));
$this->persistenceManager->persistAll();
}
$this->nodeDataRepository = $this->objectManager->get(NodeDataRepository::class);
$this->rootNode = $personalContext->getNode('/');
$this->persistenceManager->persistAll();
}
示例6: setUpRootNodeAndRepository
protected function setUpRootNodeAndRepository()
{
$this->contextFactory = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Service\\ContextFactory');
$personalContext = $this->contextFactory->create(array('workspaceName' => $this->currentTestWorkspaceName));
$this->workspaceRepository = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Repository\\WorkspaceRepository');
if ($this->liveWorkspace === NULL) {
$this->liveWorkspace = new Workspace('live');
$this->workspaceRepository->add($this->liveWorkspace);
$this->workspaceRepository->add(new Workspace($this->currentTestWorkspaceName, $this->liveWorkspace));
$this->persistenceManager->persistAll();
}
$this->nodeDataRepository = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Repository\\NodeDataRepository');
$this->rootNode = $personalContext->getNode('/');
$this->persistenceManager->persistAll();
}
示例7: setUp
public function setUp()
{
parent::setUp();
$this->workspaceRepository = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Repository\\WorkspaceRepository');
$liveWorkspace = new Workspace('live');
$this->workspaceRepository->add($liveWorkspace);
$this->nodeTypeManager = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Service\\NodeTypeManager');
$this->contextFactory = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Service\\ContextFactoryInterface');
$this->context = $this->contextFactory->create(['workspaceName' => 'live', 'dimensions' => ['language' => ['en_US']], 'targetDimensions' => ['language' => 'en_US']]);
$rootNode = $this->context->getRootNode();
$this->siteNode = $rootNode->createNode('welcome', $this->nodeTypeManager->getNodeType('TYPO3.Neos.NodeTypes:Page'));
$this->siteNode->setProperty('title', 'welcome');
$this->nodeDataRepository = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Repository\\NodeDataRepository');
$this->nodeIndexCommandController = $this->objectManager->get('Flowpack\\ElasticSearch\\ContentRepositoryAdaptor\\Command\\NodeIndexCommandController');
$this->createNodesForNodeSearchTest();
}
开发者ID:robertlemke,项目名称:Flowpack.ElasticSearch.ContentRepositoryAdaptor,代码行数:16,代码来源:ElasticSearchQueryTest.php
示例8: setUp
public function setUp()
{
parent::setUp();
$this->workspaceRepository = $this->objectManager->get(WorkspaceRepository::class);
$liveWorkspace = new Workspace('live');
$this->workspaceRepository->add($liveWorkspace);
$this->nodeTypeManager = $this->objectManager->get(NodeTypeManager::class);
$this->contextFactory = $this->objectManager->get(ContextFactoryInterface::class);
$this->context = $this->contextFactory->create(['workspaceName' => 'live', 'dimensions' => ['language' => ['en_US']], 'targetDimensions' => ['language' => 'en_US']]);
$rootNode = $this->context->getRootNode();
$this->siteNode = $rootNode->createNode('welcome', $this->nodeTypeManager->getNodeType('TYPO3.Neos.NodeTypes:Page'));
$this->siteNode->setProperty('title', 'welcome');
$this->nodeDataRepository = $this->objectManager->get(NodeDataRepository::class);
$this->nodeIndexCommandController = $this->objectManager->get(NodeIndexCommandController::class);
$this->createNodesForNodeSearchTest();
}
开发者ID:kdambekalns,项目名称:Flowpack.ElasticSearch.ContentRepositoryAdaptor,代码行数:16,代码来源:ElasticSearchQueryTest.php
示例9: setUp
public function setUp()
{
parent::setUp();
$this->workspaceRepository = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Repository\\WorkspaceRepository');
$liveWorkspace = new Workspace("live");
$this->workspaceRepository->add($liveWorkspace);
$this->nodeTypeManager = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Service\\NodeTypeManager');
$this->contextFactory = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Service\\ContextFactoryInterface');
$this->context = $this->contextFactory->create(array('workspaceName' => 'live', 'dimensions' => array('language' => array('en_US'))));
$this->nodeDataRepository = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Repository\\NodeDataRepository');
$this->queryBuilder = $this->objectManager->get('Flowpack\\ElasticSearch\\ContentRepositoryAdaptor\\Eel\\ElasticSearchQueryBuilder');
$this->nodeIndexCommandController = $this->objectManager->get('Flowpack\\ElasticSearch\\ContentRepositoryAdaptor\\Command\\NodeIndexCommandController');
$this->queryBuilder->log();
$this->initializeIndex();
$this->createNodesForNodeSearchTest();
}
开发者ID:hphoeksma,项目名称:Flowpack.ElasticSearch.ContentRepositoryAdaptor,代码行数:16,代码来源:ElasticSearchQueryTest.php
示例10: createContext
/**
* @return \TYPO3\TYPO3CR\Domain\Service\Context
*/
protected function createContext()
{
$workspace = $this->workspaceRepository->findOneByName('live');
if ($workspace === null) {
$this->workspaceRepository->add(new Workspace('live'));
}
$this->persistenceManager->persistAll();
return $this->contextFactory->create(array('workspaceName' => 'live', 'invisibleContentShown' => true, 'inaccessibleContentShown' => true));
}
示例11: setUp
public function setUp()
{
parent::setUp();
$this->workspaceRepository = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Repository\\WorkspaceRepository');
$liveWorkspace = new \TYPO3\TYPO3CR\Domain\Model\Workspace("live");
$this->workspaceRepository->add($liveWorkspace);
$this->nodeTypeManager = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Service\\NodeTypeManager');
$this->contextFactory = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Service\\ContextFactoryInterface');
$this->context = $this->contextFactory->create(array('workspaceName' => 'live', 'dimensions' => array('language' => array('de'))));
$this->nodeDataRepository = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Repository\\NodeDataRepository');
$this->queryBuilder = $this->objectManager->get('Flowpack\\ElasticSearch\\ContentRepositoryAdaptor\\Eel\\ElasticSearchQueryBuilder');
$this->queryBuilder->log();
// we need to make sure that the index will be prefixed with an unique name. so we add a sleet as it is not
// possible right now to set the index name
sleep(4);
$this->nodeIndexCommandController = $this->objectManager->get('Flowpack\\ElasticSearch\\ContentRepositoryAdaptor\\Command\\NodeIndexCommandController');
$this->nodeIndexCommandController->buildCommand();
$this->createNodesForNodeSearchTest();
}
开发者ID:johannessteu,项目名称:Flowpack.ElasticSearch.ContentRepositoryAdaptor,代码行数:19,代码来源:ElasticSearchQueryTest.php
示例12: setUp
/**
* @return void
*/
public function setUp()
{
parent::setUp();
$contentDimensionRepository = $this->objectManager->get(ContentDimensionRepository::class);
$contentDimensionRepository->setDimensionsConfiguration(array('language' => array('default' => 'mul_ZZ')));
$this->currentTestWorkspaceName = uniqid('user-');
$this->contextFactory = $this->objectManager->get(ContextFactory::class);
if ($this->liveWorkspace === null) {
$this->liveWorkspace = new Workspace('live');
$this->workspaceRepository = $this->objectManager->get(WorkspaceRepository::class);
$this->workspaceRepository->add($this->liveWorkspace);
}
$this->workspaceRepository->add(new Workspace($this->currentTestWorkspaceName, $this->liveWorkspace));
$this->personalContext = $this->contextFactory->create(array('workspaceName' => $this->currentTestWorkspaceName));
$this->liveContext = $this->contextFactory->create(array('workspaceName' => 'live'));
$this->rootNodeInLiveWorkspace = $this->liveContext->getNode('/');
$this->persistenceManager->persistAll();
$this->rootNodeInPersonalWorkspace = $this->personalContext->getNode('/');
}
示例13: setUp
/**
* @return void
*/
public function setUp()
{
parent::setUp();
$this->nodeDataRepository = new NodeDataRepository();
if ($this->liveWorkspace === null) {
$this->liveWorkspace = new Workspace('live');
$this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Repository\\WorkspaceRepository');
$this->workspaceRepository = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Repository\\WorkspaceRepository');
$this->workspaceRepository->add($this->liveWorkspace);
$this->workspaceRepository->add(new Workspace('user-admin', $this->liveWorkspace));
$this->workspaceRepository->add(new Workspace('live2', $this->liveWorkspace));
$this->workspaceRepository->add(new Workspace('test', $this->liveWorkspace));
$this->persistenceManager->persistAll();
}
$this->contextFactory = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Service\\ContextFactoryInterface');
$this->context = $this->contextFactory->create(['workspaceName' => 'live']);
$this->nodeTypeManager = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Service\\NodeTypeManager');
$this->contentDimensionRepository = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Repository\\ContentDimensionRepository');
}
示例14: setUp
/**
* @return void
*/
public function setUp()
{
parent::setUp();
$this->nodeDataRepository = new NodeDataRepository();
if ($this->liveWorkspace === null) {
$this->liveWorkspace = new Workspace('live');
$this->objectManager->get(WorkspaceRepository::class);
$this->workspaceRepository = $this->objectManager->get(WorkspaceRepository::class);
$this->workspaceRepository->add($this->liveWorkspace);
$this->workspaceRepository->add(new Workspace('user-admin', $this->liveWorkspace));
$this->workspaceRepository->add(new Workspace('live2', $this->liveWorkspace));
$this->workspaceRepository->add(new Workspace('test', $this->liveWorkspace));
$this->persistenceManager->persistAll();
}
$this->contextFactory = $this->objectManager->get(ContextFactoryInterface::class);
$this->context = $this->contextFactory->create(['workspaceName' => 'live']);
$this->nodeTypeManager = $this->objectManager->get(NodeTypeManager::class);
$this->contentDimensionRepository = $this->objectManager->get(ContentDimensionRepository::class);
}
示例15: createNodeFromTemplateUsesWorkspacesOfContext
/**
* @test
*/
public function createNodeFromTemplateUsesWorkspacesOfContext()
{
$nodeTemplate = $this->generateBasicNodeTemplate();
$userWorkspace = new Workspace('user1', $this->liveWorkspace);
$this->workspaceRepository->add($userWorkspace);
$this->context = $this->contextFactory->create(array('workspaceName' => 'user1'));
$rootNode = $this->context->getNode('/');
$node = $rootNode->createNodeFromTemplate($nodeTemplate, 'just-a-node');
$workspace = $node->getWorkspace();
$this->assertEquals('user1', $workspace->getName(), 'Node should be created in workspace of context');
}