本文整理汇总了PHP中PHPCR\SessionInterface::getItem方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionInterface::getItem方法的具体用法?PHP SessionInterface::getItem怎么用?PHP SessionInterface::getItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPCR\SessionInterface
的用法示例。
在下文中一共展示了SessionInterface::getItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeItemImmediately
/**
* Implement the workspace removeItem method.
*
* @param string $absPath the absolute path of the item to be removed
*
* @see Workspace::removeItem
*/
public function removeItemImmediately($absPath)
{
if (!$this->transport instanceof WritingInterface) {
throw new UnsupportedRepositoryOperationException('Transport does not support writing');
}
$absPath = PathHelper::normalizePath($absPath);
$item = $this->session->getItem($absPath);
// update local state and cached objects about disappeared nodes
if ($item instanceof NodeInterface) {
$this->performNodeRemove($absPath, $item, false);
$this->cascadeDelete($absPath, false);
} else {
$this->performPropertyRemove($absPath, $item, false);
}
$item->setDeleted();
}
示例2: skipByNodeTypes
/**
* @param EventInterface $event
*
* @return bool
*/
private function skipByNodeTypes(EventInterface $event)
{
if (!($path = $event->getPath())) {
// Some events (like PERSIST) do not provide an identifier
return true;
}
try {
$node = $this->session->getItem($path);
} catch (PathNotFoundException $e) {
return true;
}
if ($node instanceof PropertyInterface) {
$node = $node->getParent();
}
foreach ($this->nodeTypes as $typename) {
if ($node->isNodeType($typename)) {
return false;
}
}
return true;
}