本文整理汇总了PHP中TYPO3\TYPO3CR\Domain\Model\NodeData::setPath方法的典型用法代码示例。如果您正苦于以下问题:PHP NodeData::setPath方法的具体用法?PHP NodeData::setPath怎么用?PHP NodeData::setPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\TYPO3CR\Domain\Model\NodeData
的用法示例。
在下文中一共展示了NodeData::setPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setPath
/**
* Sets the absolute path of this node.
*
* This method is only for internal use by the content repository. Changing
* the path of a node manually may lead to unexpected behavior.
*
* @param string $path
* @param boolean $recursive
* @return void
*/
public function setPath($path, $recursive = TRUE)
{
if ($this->nodeData->getPath() === $path) {
return;
}
if ($recursive === TRUE) {
/** @var $childNode NodeInterface */
foreach ($this->getChildNodes() as $childNode) {
$childNode->setPath($path . '/' . $childNode->getNodeData()->getName(), TRUE);
}
}
if (!$this->isNodeDataMatchingContext()) {
$this->materializeNodeData();
}
$this->nodeData->setPath($path, FALSE);
$this->context->getFirstLevelNodeCache()->flush();
}
示例2: execute
/**
* Renames the node to the new name.
*
* @param NodeData $node
* @return void
*/
public function execute(NodeData $node)
{
$newNodePath = $node->getParentPath() . '/' . $this->newName;
$node->setPath($newNodePath);
}
示例3: adjustShadowNodePath
/**
* Adjusts the path of $shadowNodeData to $path, if needed/possible.
*
* If the $path is occupied in $targetWorkspace, the shadow is removed.
*
* @param NodeData $shadowNodeData
* @param $path
* @param Workspace $targetWorkspace
* @param array $dimensionValues
* @return void
*/
protected function adjustShadowNodePath(NodeData $shadowNodeData, $path, Workspace $targetWorkspace, array $dimensionValues)
{
$nodeOnSamePathInTargetWorkspace = $this->nodeDataRepository->findOneByPath($path, $targetWorkspace, $dimensionValues);
if ($nodeOnSamePathInTargetWorkspace === null || $nodeOnSamePathInTargetWorkspace->getWorkspace() !== $targetWorkspace) {
$shadowNodeData->setPath($path, false);
return;
}
// A node exists in that path, so no shadow node is needed/possible.
$this->nodeDataRepository->remove($shadowNodeData);
}
示例4: execute
/**
* Renames the node to the new name.
*
* @param \TYPO3\TYPO3CR\Domain\Model\NodeData $node
* @return void
*/
public function execute(\TYPO3\TYPO3CR\Domain\Model\NodeData $node)
{
$newNodePath = $node->getParentPath() . '/' . $this->newName;
$node->setPath($newNodePath);
}