Groups.php 696 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OCA\DAV\CardDAV\Xml;
  8. use Sabre\Xml\Writer;
  9. use Sabre\Xml\XmlSerializable;
  10. class Groups implements XmlSerializable {
  11. public const NS_OWNCLOUD = 'http://owncloud.org/ns';
  12. /** @var string[] of TYPE:CHECKSUM */
  13. private $groups;
  14. /**
  15. * @param string $groups
  16. */
  17. public function __construct($groups) {
  18. $this->groups = $groups;
  19. }
  20. public function xmlSerialize(Writer $writer) {
  21. foreach ($this->groups as $group) {
  22. $writer->writeElement('{' . self::NS_OWNCLOUD . '}group', $group);
  23. }
  24. }
  25. }