ITagManager.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Bernhard Reiter <ockham@raz.or.at>
  6. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  7. * @author Morris Jobke <hey@morrisjobke.de>
  8. * @author Roeland Jago Douma <roeland@famdouma.nl>
  9. * @author Thomas Tanghus <thomas@tanghus.net>
  10. *
  11. * @license AGPL-3.0
  12. *
  13. * This code is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License, version 3,
  15. * as published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License, version 3,
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>
  24. *
  25. */
  26. // use OCP namespace for all classes that are considered public.
  27. // This means that they should be used by apps instead of the internal ownCloud classes
  28. namespace OCP;
  29. /**
  30. * Factory class creating instances of \OCP\ITags
  31. *
  32. * A tag can be e.g. 'Family', 'Work', 'Chore', 'Special Occation' or
  33. * anything else that is either parsed from a vobject or that the user chooses
  34. * to add.
  35. * Tag names are not case-sensitive, but will be saved with the case they
  36. * are entered in. If a user already has a tag 'family' for a type, and
  37. * tries to add a tag named 'Family' it will be silently ignored.
  38. * @since 6.0.0
  39. */
  40. interface ITagManager {
  41. /**
  42. * Create a new \OCP\ITags instance and load tags from db for the current user.
  43. *
  44. * @see \OCP\ITags
  45. * @param string $type The type identifier e.g. 'contact' or 'event'.
  46. * @param array $defaultTags An array of default tags to be used if none are stored.
  47. * @param boolean $includeShared Whether to include tags for items shared with this user by others. - always false since 20.0.0
  48. * @param string $userId user for which to retrieve the tags, defaults to the currently
  49. * logged in user
  50. * @return \OCP\ITags
  51. * @since 6.0.0 - parameter $includeShared and $userId were added in 8.0.0 - $includeShared is always false since 20.0.0
  52. */
  53. public function load($type, $defaultTags = [], $includeShared = false, $userId = null);
  54. }