本文整理汇总了PHP中TYPO3\TYPO3CR\Domain\Model\NodeInterface::isAutoCreated方法的典型用法代码示例。如果您正苦于以下问题:PHP NodeInterface::isAutoCreated方法的具体用法?PHP NodeInterface::isAutoCreated怎么用?PHP NodeInterface::isAutoCreated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\TYPO3CR\Domain\Model\NodeInterface
的用法示例。
在下文中一共展示了NodeInterface::isAutoCreated方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addGenericEditingMetadata
/**
* Collects metadata attributes used to allow editing of the node in the Neos backend.
*
* @param array $attributes
* @param NodeInterface $node
* @return array
*/
protected function addGenericEditingMetadata(array $attributes, NodeInterface $node)
{
$attributes['typeof'] = 'typo3:' . $node->getNodeType()->getName();
$attributes['about'] = $node->getContextPath();
$attributes['data-node-_identifier'] = $node->getIdentifier();
$attributes['data-node-__workspace-name'] = $node->getWorkspace()->getName();
$attributes['data-node-__label'] = $node->getLabel();
if ($node->getNodeType()->isOfType('TYPO3.Neos:ContentCollection')) {
$attributes['rel'] = 'typo3:content-collection';
}
// these properties are needed together with the current NodeType to evaluate Node Type Constraints
// TODO: this can probably be greatly cleaned up once we do not use CreateJS or VIE anymore.
if ($node->getParent()) {
$attributes['data-node-__parent-node-type'] = $node->getParent()->getNodeType()->getName();
}
if ($node->isAutoCreated()) {
$attributes['data-node-_name'] = $node->getName();
$attributes['data-node-_is-autocreated'] = 'true';
}
if ($node->getParent() && $node->getParent()->isAutoCreated()) {
$attributes['data-node-_parent-is-autocreated'] = 'true';
// we shall only add these properties if the parent is actually auto-created; as the Node-Type-Switcher in the UI relies on that.
$attributes['data-node-__parent-node-name'] = $node->getParent()->getName();
$attributes['data-node-__grandparent-node-type'] = $node->getParent()->getParent()->getNodeType()->getName();
}
return $attributes;
}
示例2: collectTreeNodeData
/**
* @param NodeInterface $node
* @param boolean $expand
* @param array $children
* @param boolean $hasChildNodes
* @param boolean $matched
* @return array
*/
public function collectTreeNodeData(NodeInterface $node, $expand = TRUE, array $children = array(), $hasChildNodes = FALSE, $matched = FALSE)
{
$isTimedPage = FALSE;
$now = new \DateTime();
$now = $now->getTimestamp();
$hiddenBeforeDateTime = $node->getHiddenBeforeDateTime();
$hiddenAfterDateTime = $node->getHiddenAfterDateTime();
if ($hiddenBeforeDateTime !== NULL && $hiddenBeforeDateTime->getTimestamp() > $now) {
$isTimedPage = TRUE;
}
if ($hiddenAfterDateTime !== NULL) {
$isTimedPage = TRUE;
}
$classes = array();
if ($isTimedPage === TRUE && $node->isHidden() === FALSE) {
array_push($classes, 'neos-timedVisibility');
}
if ($node->isHidden() === TRUE) {
array_push($classes, 'neos-hidden');
}
if ($node->isHiddenInIndex() === TRUE) {
array_push($classes, 'neos-hiddenInIndex');
}
if ($matched) {
array_push($classes, 'neos-matched');
}
$uriBuilder = $this->controllerContext->getUriBuilder();
$nodeType = $node->getNodeType();
$nodeTypeConfiguration = $nodeType->getFullConfiguration();
if ($node->getNodeType()->isOfType('TYPO3.Neos:Document')) {
$uriForNode = $uriBuilder->reset()->setFormat('html')->setCreateAbsoluteUri(TRUE)->uriFor('show', array('node' => $node), 'Frontend\\Node', 'TYPO3.Neos');
} else {
$uriForNode = '#';
}
$label = $node->getLabel();
$nodeTypeLabel = $node->getNodeType()->getLabel();
$treeNode = array('key' => $node->getContextPath(), 'title' => $label, 'fullTitle' => $node->getProperty('title'), 'nodeTypeLabel' => $nodeTypeLabel, 'tooltip' => '', 'href' => $uriForNode, 'isFolder' => $hasChildNodes, 'isLazy' => $hasChildNodes && !$expand, 'nodeType' => $nodeType->getName(), 'isAutoCreated' => $node->isAutoCreated(), 'expand' => $expand, 'addClass' => implode(' ', $classes), 'name' => $node->getName(), 'iconClass' => isset($nodeTypeConfiguration['ui']) && isset($nodeTypeConfiguration['ui']['icon']) ? $nodeTypeConfiguration['ui']['icon'] : '', 'isHidden' => $node->isHidden());
if ($hasChildNodes) {
$treeNode['children'] = $children;
}
return $treeNode;
}