AbstractBackend.php 1003 B

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