6 * This object is responsible for generating a collection of users.
10 * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
11 * @author Evert Pot (http://www.rooftopsolutions.nl/)
12 * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
14 class Sabre_CalDAV_AnimexxCalendarRootNode extends Sabre_DAVACL_AbstractPrincipalCollection {
19 * @var array|Sabre_CalDAV_Backend_Abstract[]
21 protected $caldavBackends;
26 * This constructor needs both an authentication and a caldav backend.
28 * @param Sabre_DAVACL_IPrincipalBackend $principalBackend
29 * @param array|Sabre_CalDAV_Backend_Abstract[] $caldavBackends
30 * @param string $principalPrefix
32 public function __construct(Sabre_DAVACL_IPrincipalBackend $principalBackend,$caldavBackends, $principalPrefix = 'principals/users') {
34 parent::__construct($principalBackend, $principalPrefix);
35 $this->caldavBackends = $caldavBackends;
40 * Returns the nodename
42 * We're overriding this, because the default will be the 'principalPrefix',
43 * and we want it to be Sabre_CalDAV_Plugin::CALENDAR_ROOT
47 public function getName() {
49 return Sabre_CalDAV_Plugin::CALENDAR_ROOT;
54 * This method returns a node for a principal.
56 * The passed array contains principal information, and is guaranteed to
57 * at least contain a uri item. Other properties may or may not be
58 * supplied by the authentication backend.
60 * @param array $principal
61 * @return \Sabre_CalDAV_AnimexxUserCalendars|\Sabre_DAVACL_IPrincipal
63 public function getChildForPrincipal(array $principal) {
65 return new Sabre_CalDAV_AnimexxUserCalendars($this->principalBackend, $this->caldavBackends, $principal['uri']);