18                    'uri'                                   => 
'principals/user1',
 
   19                    '{DAV:}displayname'                     => 
'User 1',
 
   20                    '{http://sabredav.org/ns}email-address' => 
'user1.sabredav@sabredav.org',
 
   21                    '{http://sabredav.org/ns}vcard-url'     => 
'addressbooks/user1/book1/vcard1.vcf',
 
   24                    'uri'               => 
'principals/admin',
 
   25                    '{DAV:}displayname' => 
'Admin',
 
   28                    'uri'                                   => 
'principals/user2',
 
   29                    '{DAV:}displayname'                     => 
'User 2',
 
   30                    '{http://sabredav.org/ns}email-address' => 
'user2.sabredav@sabredav.org',
 
   40        $prefix = trim($prefix, 
'/');
 
   41        if ($prefix) $prefix .= 
'/';
 
   44        foreach ($this->principals as $principal) {
 
   46            if ($prefix && strpos($principal[
'uri'], $prefix) !== 0) 
continue;
 
   48            $return[] = $principal;
 
   58        $this->principals[] = $principal;
 
   65            if ($principal[
'uri'] === 
$path) 
return $principal;
 
   75            foreach ($searchProperties as 
$key => $value) {
 
   77                if (!isset($principal[
$key])) {
 
   80                if (mb_stripos($principal[
$key], $value, 0, 
'UTF-8') === 
false) {
 
   85                if (
$test === 
'allof') {
 
   92            $matches[] = $principal[
'uri'];
 
  101        return isset($this->groupMembers[
$path]) ? $this->groupMembers[
$path] : [];
 
  108        foreach ($this->groupMembers as $group => $members) {
 
  109            if (in_array(
$path, $members)) $membership[] = $group;
 
  117        $this->groupMembers[
$path] = $members;
 
  139        foreach ($this->principals as $principalIndex => $value) {
 
  140            if ($value[
'uri'] === 
$path) {
 
  145        if (!$principal) 
return;
 
  147        $propPatch->handleRemaining(
function($mutations) use ($principal, $principalIndex) {
 
  149            foreach ($mutations as $prop => $value) {
 
  151                if (is_null($value) && isset($principal[$prop])) {
 
  152                    unset($principal[$prop]);
 
  154                    $principal[$prop] = $value;
 
  159            $this->principals[$principalIndex] = $principal;
 
An exception for terminatinating execution or to throw for unit testing.
Abstract Principal Backend.
getGroupMembership($path)
Returns the list of groups a principal is a member of.
searchPrincipals($prefixPath, array $searchProperties, $test='allof')
This method is used to search for principals matching a set of properties.
addPrincipal(array $principal)
getPrincipalsByPrefix($prefix)
Returns a list of principals based on a prefix.
setGroupMemberSet($path, array $members)
Updates the list of group members for a group principal.
getGroupMemberSet($path)
Returns the list of members for a group-principal.
getPrincipalByPath($path)
Returns a specific principal, specified by it's path.
updatePrincipal($path, \Sabre\DAV\PropPatch $propPatch)
Updates one ore more webdav properties on a principal.
__construct(array $principals=null)
This class represents a set of properties that are going to be updated.