本文整理匯總了PHP中Sabre\DAV\INode::setGroupMemberSet方法的典型用法代碼示例。如果您正苦於以下問題:PHP INode::setGroupMemberSet方法的具體用法?PHP INode::setGroupMemberSet怎麽用?PHP INode::setGroupMemberSet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sabre\DAV\INode
的用法示例。
在下文中一共展示了INode::setGroupMemberSet方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: updateProperties
/**
* This method intercepts PROPPATCH methods and make sure the
* group-member-set is updated correctly.
*
* @param array $propertyDelta
* @param array $result
* @param DAV\INode $node
* @return bool
*/
public function updateProperties(&$propertyDelta, &$result, DAV\INode $node)
{
if (!array_key_exists('{DAV:}group-member-set', $propertyDelta)) {
return;
}
if (is_null($propertyDelta['{DAV:}group-member-set'])) {
$memberSet = array();
} elseif ($propertyDelta['{DAV:}group-member-set'] instanceof DAV\Property\HrefList) {
$memberSet = array_map(array($this->server, 'calculateUri'), $propertyDelta['{DAV:}group-member-set']->getHrefs());
} else {
throw new DAV\Exception('The group-member-set property MUST be an instance of Sabre\\DAV\\Property\\HrefList or null');
}
if (!$node instanceof IPrincipal) {
$result[403]['{DAV:}group-member-set'] = null;
unset($propertyDelta['{DAV:}group-member-set']);
// Returning false will stop the updateProperties process
return false;
}
$node->setGroupMemberSet($memberSet);
// We must also clear our cache, just in case
$this->principalMembershipCache = array();
$result[200]['{DAV:}group-member-set'] = null;
unset($propertyDelta['{DAV:}group-member-set']);
}