3 class Sabre_CardDAV_AddressBookRootFriendica extends Sabre_DAVACL_AbstractPrincipalCollection {
8 * @var Sabre_DAVACL_IPrincipalBackend
10 protected $principalBackend;
15 * @var array|Sabre_CardDAV_Backend_Abstract[]
17 protected $carddavBackends;
22 * This constructor needs both a principal and a carddav backend.
24 * By default this class will show a list of addressbook collections for
25 * principals in the 'principals' collection. If your main principals are
26 * actually located in a different path, use the $principalPrefix argument
29 * @param Sabre_DAVACL_IPrincipalBackend $principalBackend
30 * @param array|Sabre_CardDAV_Backend_Abstract[] $carddavBackends
31 * @param string $principalPrefix
33 public function __construct(Sabre_DAVACL_IPrincipalBackend $principalBackend, $carddavBackends, $principalPrefix = 'principals/users') {
35 $this->carddavBackends = $carddavBackends;
36 parent::__construct($principalBackend, $principalPrefix);
41 * Returns the name of the node
45 public function getName() {
46 return Sabre_CardDAV_Plugin::ADDRESSBOOK_ROOT;
50 * This method returns a node for a principal.
52 * The passed array contains principal information, and is guaranteed to
53 * at least contain a uri item. Other properties may or may not be
54 * supplied by the authentication backend.
56 * @param array $principal
57 * @return Sabre_DAVACL_IPrincipal
59 public function getChildForPrincipal(array $principal) {
60 return new Sabre_CardDAV_UserAddressBooksMultiBackend($this->carddavBackends, $principal['uri']);