ITagManager.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. // use OCP namespace for all classes that are considered public.
  8. // This means that they should be used by apps instead of the internal Nextcloud classes
  9. namespace OCP;
  10. /**
  11. * Factory class creating instances of \OCP\ITags
  12. *
  13. * A tag can be e.g. 'Family', 'Work', 'Chore', 'Special Occation' or
  14. * anything else that is either parsed from a vobject or that the user chooses
  15. * to add.
  16. * Tag names are not case-sensitive, but will be saved with the case they
  17. * are entered in. If a user already has a tag 'family' for a type, and
  18. * tries to add a tag named 'Family' it will be silently ignored.
  19. * @since 6.0.0
  20. */
  21. interface ITagManager {
  22. /**
  23. * Create a new \OCP\ITags instance and load tags from db for the current user.
  24. *
  25. * @see \OCP\ITags
  26. * @param string $type The type identifier e.g. 'contact' or 'event'.
  27. * @param array $defaultTags An array of default tags to be used if none are stored.
  28. * @param boolean $includeShared Whether to include tags for items shared with this user by others. - always false since 20.0.0
  29. * @param string $userId user for which to retrieve the tags, defaults to the currently
  30. * logged in user
  31. * @return \OCP\ITags
  32. * @since 6.0.0 - parameter $includeShared and $userId were added in 8.0.0 - $includeShared is always false since 20.0.0
  33. */
  34. public function load($type, $defaultTags = [], $includeShared = false, $userId = null);
  35. }