本文整理汇总了PHP中TYPO3\TYPO3CR\Domain\Model\NodeData::getWorkspace方法的典型用法代码示例。如果您正苦于以下问题:PHP NodeData::getWorkspace方法的具体用法?PHP NodeData::getWorkspace怎么用?PHP NodeData::getWorkspace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\TYPO3CR\Domain\Model\NodeData
的用法示例。
在下文中一共展示了NodeData::getWorkspace方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setWorkspacesAllowsForSettingTheWorkspaceForInternalPurposes
/**
* @test
*/
public function setWorkspacesAllowsForSettingTheWorkspaceForInternalPurposes()
{
$newWorkspace = $this->getMock('TYPO3\\TYPO3CR\\Domain\\Model\\Workspace', array(), array(), '', FALSE);
$this->assertSame($this->mockWorkspace, $this->nodeData->getWorkspace());
$this->nodeData->setWorkspace($newWorkspace);
$this->assertSame($newWorkspace, $this->nodeData->getWorkspace());
}
示例2: isNodeDataMatchingContext
/**
* The NodeData matches the context if the workspace matches exactly.
* Needs to be adjusted for further context dimensions.
*
* @return boolean
*/
protected function isNodeDataMatchingContext()
{
if ($this->nodeDataIsMatchingContext === NULL) {
$workspacesMatch = $this->nodeData->getWorkspace() !== NULL && $this->context->getWorkspace() !== NULL && $this->nodeData->getWorkspace()->getName() === $this->context->getWorkspace()->getName();
$this->nodeDataIsMatchingContext = $workspacesMatch && $this->dimensionsAreMatchingTargetDimensionValues();
}
return $this->nodeDataIsMatchingContext;
}
示例3: setWorkspacesAllowsForSettingTheWorkspaceForInternalPurposes
/**
* @test
*/
public function setWorkspacesAllowsForSettingTheWorkspaceForInternalPurposes()
{
/** @var Workspace|\PHPUnit_Framework_MockObject_MockObject $newWorkspace */
$newWorkspace = $this->getMockBuilder('TYPO3\\TYPO3CR\\Domain\\Model\\Workspace')->disableOriginalConstructor()->getMock();
$this->assertSame($this->mockWorkspace, $this->nodeData->getWorkspace());
$this->nodeData->setWorkspace($newWorkspace);
$this->assertSame($newWorkspace, $this->nodeData->getWorkspace());
}
示例4: setWorkspacesAllowsForSettingTheWorkspaceForInternalPurposes
/**
* @test
*/
public function setWorkspacesAllowsForSettingTheWorkspaceForInternalPurposes()
{
/** @var Workspace|\PHPUnit_Framework_MockObject_MockObject $newWorkspace */
$newWorkspace = $this->getMock('TYPO3\\TYPO3CR\\Domain\\Model\\Workspace', array(), array(), '', false);
$this->assertSame($this->mockWorkspace, $this->nodeData->getWorkspace());
$this->nodeData->setWorkspace($newWorkspace);
$this->assertSame($newWorkspace, $this->nodeData->getWorkspace());
}
示例5: createContextMatchingNodeData
/**
* Generates a Context that exactly fits the given NodeData Workspace, Dimensions & Site.
*
* @param NodeData $nodeData
* @return ContentContext
*/
protected function createContextMatchingNodeData(NodeData $nodeData)
{
$nodePath = NodePaths::getRelativePathBetween(SiteService::SITES_ROOT_PATH, $nodeData->getPath());
list($siteNodeName) = explode('/', $nodePath);
$site = $this->siteRepository->findOneByNodeName($siteNodeName);
$contextProperties = ['workspaceName' => $nodeData->getWorkspace()->getName(), 'invisibleContentShown' => true, 'inaccessibleContentShown' => true, 'removedContentShown' => true, 'dimensions' => $nodeData->getDimensionValues(), 'currentSite' => $site];
if ($domain = $site->getFirstActiveDomain()) {
$contextProperties['currentDomain'] = $domain;
}
return $this->_contextFactory->create($contextProperties);
}
示例6: execute
/**
* Change the property on the given node.
*
* @param NodeData $node
* @return NodeData
*/
public function execute(NodeData $node)
{
$reference = (string) $node->getProperty('plugin');
$workspace = $node->getWorkspace();
do {
if ($this->reverse === false && preg_match(NodeInterface::MATCH_PATTERN_PATH, $reference)) {
$pluginNode = $this->nodeDataRepository->findOneByPath($reference, $node->getWorkspace());
} else {
$pluginNode = $this->nodeDataRepository->findOneByIdentifier($reference, $node->getWorkspace());
}
if (isset($pluginNode)) {
break;
}
$workspace = $workspace->getBaseWorkspace();
} while ($workspace && $workspace->getName() !== 'live');
if (isset($pluginNode)) {
$node->setProperty('plugin', $this->reverse === false ? $pluginNode->getIdentifier() : $pluginNode->getPath());
}
return $node;
}
示例7: matches
/**
* Returns TRUE if the given node is in the workspace this filter expects.
*
* @param \TYPO3\TYPO3CR\Domain\Model\NodeData $node
* @return boolean
*/
public function matches(\TYPO3\TYPO3CR\Domain\Model\NodeData $node)
{
return $node->getWorkspace() !== NULL && $node->getWorkspace()->getName() === $this->workspaceName;
}
示例8: matches
/**
* Returns TRUE if the given node is in the workspace this filter expects.
*
* @param NodeData $node
* @return boolean
*/
public function matches(NodeData $node)
{
return $node->getWorkspace() !== null && $node->getWorkspace()->getName() === $this->workspaceName;
}
示例9: createContextMatchingNodeData
/**
* Generates a Context that exactly fits the given NodeData Workspace and Dimensions.
*
* TODO: We could get more specific about removed and invisible content by adding some more logic here that generates fitting values.
*
* @param NodeData $nodeData
* @return Context
*/
public function createContextMatchingNodeData(NodeData $nodeData)
{
return $this->contextFactory->create(array('workspaceName' => $nodeData->getWorkspace()->getName(), 'invisibleContentShown' => true, 'inaccessibleContentShown' => true, 'removedContentShown' => true, 'dimensions' => $nodeData->getDimensionValues()));
}