本文整理汇总了PHP中TYPO3\TYPO3CR\Domain\Service\Context::isRemovedContentShown方法的典型用法代码示例。如果您正苦于以下问题:PHP Context::isRemovedContentShown方法的具体用法?PHP Context::isRemovedContentShown怎么用?PHP Context::isRemovedContentShown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\TYPO3CR\Domain\Service\Context
的用法示例。
在下文中一共展示了Context::isRemovedContentShown方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filterNodeByContext
/**
* Filter a node by the current context.
* Will either return the node or NULL if it is not permitted in current context.
*
* @param NodeInterface $node
* @param Context $context
* @return \TYPO3\TYPO3CR\Domain\Model\Node|NULL
*/
protected function filterNodeByContext(NodeInterface $node, Context $context)
{
if (!$context->isRemovedContentShown() && $node->isRemoved()) {
return NULL;
}
if (!$context->isInvisibleContentShown() && !$node->isVisible()) {
return NULL;
}
if (!$context->isInaccessibleContentShown() && !$node->isAccessible()) {
return NULL;
}
return $node;
}
示例2: findFirstByParentAndNodeTypeInContext
/**
* Finds a single node by its parent and (optionally) by its node type
*
* @param string $parentPath Absolute path of the parent node
* @param string $nodeTypeFilter Filter the node type of the nodes, allows complex expressions (e.g. "TYPO3.Neos:Page", "!TYPO3.Neos:Page,TYPO3.Neos:Text" or NULL)
* @param Context $context The containing context
* @return NodeData The node found or NULL
*/
public function findFirstByParentAndNodeTypeInContext($parentPath, $nodeTypeFilter, Context $context)
{
$firstNode = $this->findFirstByParentAndNodeType($parentPath, $nodeTypeFilter, $context->getWorkspace(), $context->getDimensions(), $context->isRemovedContentShown() ? null : false);
if ($firstNode !== null) {
$firstNode = $this->nodeFactory->createFromNodeData($firstNode, $context);
}
return $firstNode;
}
示例3: filterNodeByContext
/**
* Filter a node by the current context.
* Will either return the node or NULL if it is not permitted in current context.
*
* @param NodeInterface $node
* @param Context $context
* @return \TYPO3\TYPO3CR\Domain\Model\NodeInterface|NULL
*/
protected function filterNodeByContext(NodeInterface $node, Context $context)
{
$this->securityContext->withoutAuthorizationChecks(function () use(&$node, $context) {
if (!$context->isRemovedContentShown() && $node->isRemoved()) {
$node = null;
return;
}
if (!$context->isInvisibleContentShown() && !$node->isVisible()) {
$node = null;
return;
}
if (!$context->isInaccessibleContentShown() && !$node->isAccessible()) {
$node = null;
}
});
return $node;
}