本文整理汇总了PHP中Sabre\DAV\INode::getShareAccess方法的典型用法代码示例。如果您正苦于以下问题:PHP INode::getShareAccess方法的具体用法?PHP INode::getShareAccess怎么用?PHP INode::getShareAccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sabre\DAV\INode
的用法示例。
在下文中一共展示了INode::getShareAccess方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: propFind
/**
* This event is triggered when properties are requested for nodes.
*
* This allows us to inject any sharings-specific properties.
*
* @param PropFind $propFind
* @param INode $node
* @return void
*/
function propFind(PropFind $propFind, INode $node)
{
if ($node instanceof ISharedNode) {
$propFind->handle('{DAV:}share-access', function () use($node) {
return new Property\ShareAccess($node->getShareAccess());
});
$propFind->handle('{DAV:}invite', function () use($node) {
return new Property\Invite($node->getInvites());
});
$propFind->handle('{DAV:}share-resource-uri', function () use($node) {
return new Property\Href($node->getShareResourceUri());
});
}
}
示例2: propFindLate
/**
* This method is triggered *after* all properties have been retrieved.
* This allows us to inject the correct resourcetype for calendars that
* have been shared.
*
* @param DAV\PropFind $propFind
* @param DAV\INode $node
* @return void
*/
function propFindLate(DAV\PropFind $propFind, DAV\INode $node)
{
if ($node instanceof ISharedCalendar) {
$shareAccess = $node->getShareAccess();
if ($rt = $propFind->get('{DAV:}resourcetype')) {
switch ($shareAccess) {
case \Sabre\DAV\Sharing\Plugin::ACCESS_SHAREDOWNER:
$rt->add('{' . Plugin::NS_CALENDARSERVER . '}shared-owner');
break;
case \Sabre\DAV\Sharing\Plugin::ACCESS_READ:
case \Sabre\DAV\Sharing\Plugin::ACCESS_READWRITE:
$rt->add('{' . Plugin::NS_CALENDARSERVER . '}shared');
break;
}
}
$propFind->handle('{' . Plugin::NS_CALENDARSERVER . '}allowed-sharing-modes', function () {
return new Xml\Property\AllowedSharingModes(true, false);
});
}
}