xref: /plugin/davcal/vendor/sabre/dav/lib/DAVACL/IPrincipalCollection.php (revision a1a3b6794e0e143a4a8b51d3185ce2d339be61ab)
1*a1a3b679SAndreas Boehler<?php
2*a1a3b679SAndreas Boehler
3*a1a3b679SAndreas Boehlernamespace Sabre\DAVACL;
4*a1a3b679SAndreas Boehler
5*a1a3b679SAndreas Boehleruse Sabre\DAV;
6*a1a3b679SAndreas Boehler
7*a1a3b679SAndreas Boehler/**
8*a1a3b679SAndreas Boehler * Principal Collection interface.
9*a1a3b679SAndreas Boehler *
10*a1a3b679SAndreas Boehler * Implement this interface to ensure that your principal collection can be
11*a1a3b679SAndreas Boehler * searched using the principal-property-search REPORT.
12*a1a3b679SAndreas Boehler *
13*a1a3b679SAndreas Boehler * @copyright Copyright (C) 2007-2015 fruux GmbH (https://fruux.com/).
14*a1a3b679SAndreas Boehler * @author Evert Pot (http://evertpot.com/)
15*a1a3b679SAndreas Boehler * @license http://sabre.io/license/ Modified BSD License
16*a1a3b679SAndreas Boehler */
17*a1a3b679SAndreas Boehlerinterface IPrincipalCollection extends DAV\ICollection {
18*a1a3b679SAndreas Boehler
19*a1a3b679SAndreas Boehler    /**
20*a1a3b679SAndreas Boehler     * This method is used to search for principals matching a set of
21*a1a3b679SAndreas Boehler     * properties.
22*a1a3b679SAndreas Boehler     *
23*a1a3b679SAndreas Boehler     * This search is specifically used by RFC3744's principal-property-search
24*a1a3b679SAndreas Boehler     * REPORT. You should at least allow searching on
25*a1a3b679SAndreas Boehler     * http://sabredav.org/ns}email-address.
26*a1a3b679SAndreas Boehler     *
27*a1a3b679SAndreas Boehler     * The actual search should be a unicode-non-case-sensitive search. The
28*a1a3b679SAndreas Boehler     * keys in searchProperties are the WebDAV property names, while the values
29*a1a3b679SAndreas Boehler     * are the property values to search on.
30*a1a3b679SAndreas Boehler     *
31*a1a3b679SAndreas Boehler     * By default, if multiple properties are submitted to this method, the
32*a1a3b679SAndreas Boehler     * various properties should be combined with 'AND'. If $test is set to
33*a1a3b679SAndreas Boehler     * 'anyof', it should be combined using 'OR'.
34*a1a3b679SAndreas Boehler     *
35*a1a3b679SAndreas Boehler     * This method should simply return a list of 'child names', which may be
36*a1a3b679SAndreas Boehler     * used to call $this->getChild in the future.
37*a1a3b679SAndreas Boehler     *
38*a1a3b679SAndreas Boehler     * @param array $searchProperties
39*a1a3b679SAndreas Boehler     * @param string $test
40*a1a3b679SAndreas Boehler     * @return array
41*a1a3b679SAndreas Boehler     */
42*a1a3b679SAndreas Boehler    function searchPrincipals(array $searchProperties, $test = 'allof');
43*a1a3b679SAndreas Boehler
44*a1a3b679SAndreas Boehler    /**
45*a1a3b679SAndreas Boehler     * Finds a principal by its URI.
46*a1a3b679SAndreas Boehler     *
47*a1a3b679SAndreas Boehler     * This method may receive any type of uri, but mailto: addresses will be
48*a1a3b679SAndreas Boehler     * the most common.
49*a1a3b679SAndreas Boehler     *
50*a1a3b679SAndreas Boehler     * Implementation of this API is optional. It is currently used by the
51*a1a3b679SAndreas Boehler     * CalDAV system to find principals based on their email addresses. If this
52*a1a3b679SAndreas Boehler     * API is not implemented, some features may not work correctly.
53*a1a3b679SAndreas Boehler     *
54*a1a3b679SAndreas Boehler     * This method must return a relative principal path, or null, if the
55*a1a3b679SAndreas Boehler     * principal was not found or you refuse to find it.
56*a1a3b679SAndreas Boehler     *
57*a1a3b679SAndreas Boehler     * @param string $uri
58*a1a3b679SAndreas Boehler     * @return string
59*a1a3b679SAndreas Boehler     */
60*a1a3b679SAndreas Boehler    function findByUri($uri);
61*a1a3b679SAndreas Boehler
62*a1a3b679SAndreas Boehler}
63