xref: /plugin/davcal/vendor/sabre/dav/lib/CardDAV/Backend/AbstractBackend.php (revision a1a3b6794e0e143a4a8b51d3185ce2d339be61ab)
1*a1a3b679SAndreas Boehler<?php
2*a1a3b679SAndreas Boehler
3*a1a3b679SAndreas Boehlernamespace Sabre\CardDAV\Backend;
4*a1a3b679SAndreas Boehler
5*a1a3b679SAndreas Boehler/**
6*a1a3b679SAndreas Boehler * CardDAV abstract Backend
7*a1a3b679SAndreas Boehler *
8*a1a3b679SAndreas Boehler * This class serves as a base-class for addressbook backends
9*a1a3b679SAndreas Boehler *
10*a1a3b679SAndreas Boehler * This class doesn't do much, but it was added for consistency.
11*a1a3b679SAndreas Boehler *
12*a1a3b679SAndreas Boehler * @copyright Copyright (C) 2007-2015 fruux GmbH (https://fruux.com/).
13*a1a3b679SAndreas Boehler * @author Evert Pot (http://evertpot.com/)
14*a1a3b679SAndreas Boehler * @license http://sabre.io/license/ Modified BSD License
15*a1a3b679SAndreas Boehler */
16*a1a3b679SAndreas Boehlerabstract class AbstractBackend implements BackendInterface {
17*a1a3b679SAndreas Boehler
18*a1a3b679SAndreas Boehler    /**
19*a1a3b679SAndreas Boehler     * Returns a list of cards.
20*a1a3b679SAndreas Boehler     *
21*a1a3b679SAndreas Boehler     * This method should work identical to getCard, but instead return all the
22*a1a3b679SAndreas Boehler     * cards in the list as an array.
23*a1a3b679SAndreas Boehler     *
24*a1a3b679SAndreas Boehler     * If the backend supports this, it may allow for some speed-ups.
25*a1a3b679SAndreas Boehler     *
26*a1a3b679SAndreas Boehler     * @param mixed $addressBookId
27*a1a3b679SAndreas Boehler     * @param array $uris
28*a1a3b679SAndreas Boehler     * @return array
29*a1a3b679SAndreas Boehler     */
30*a1a3b679SAndreas Boehler    function getMultipleCards($addressBookId, array $uris) {
31*a1a3b679SAndreas Boehler
32*a1a3b679SAndreas Boehler        return array_map(function($uri) use ($addressBookId) {
33*a1a3b679SAndreas Boehler            return $this->getCard($addressBookId, $uri);
34*a1a3b679SAndreas Boehler        }, $uris);
35*a1a3b679SAndreas Boehler
36*a1a3b679SAndreas Boehler    }
37*a1a3b679SAndreas Boehler
38*a1a3b679SAndreas Boehler}
39