本文整理汇总了PHP中TYPO3\TYPO3CR\Domain\Model\NodeInterface::willChildNodeBeAutoCreated方法的典型用法代码示例。如果您正苦于以下问题:PHP NodeInterface::willChildNodeBeAutoCreated方法的具体用法?PHP NodeInterface::willChildNodeBeAutoCreated怎么用?PHP NodeInterface::willChildNodeBeAutoCreated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\TYPO3CR\Domain\Model\NodeInterface
的用法示例。
在下文中一共展示了NodeInterface::willChildNodeBeAutoCreated方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: copyIntoInternal
/**
* Internal method to do the actual copying.
*
* For behavior of the $detachedCopy parameter, see method Node::createRecursiveCopy().
*
* @param NodeInterface $referenceNode
* @param $nodeName
* @param boolean $detachedCopy
* @return NodeInterface
* @throws NodeConstraintException
* @throws NodeExistsException
*/
protected function copyIntoInternal(NodeInterface $referenceNode, $nodeName, $detachedCopy)
{
if ($referenceNode->getNode($nodeName) !== null) {
throw new NodeExistsException('Node with path "' . $referenceNode->getPath() . '/' . $nodeName . '" already exists.', 1292503467);
}
// On copy we basically re-recreate an existing node on a new location. As we skip the constraints check on
// node creation we should do the same while writing the node on the new location.
if (!$referenceNode->willChildNodeBeAutoCreated($nodeName) && !$referenceNode->isNodeTypeAllowedAsChildNode($this->getNodeType())) {
throw new NodeConstraintException(sprintf('Cannot copy "%s" into "%s" due to node type constraints.', $this->__toString(), $referenceNode->__toString()), 1404648177);
}
$copiedNode = $this->createRecursiveCopy($referenceNode, $nodeName, $detachedCopy);
$this->context->getFirstLevelNodeCache()->flush();
$this->emitNodeAdded($copiedNode);
return $copiedNode;
}