ITagManager.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Bernhard Reiter <ockham@raz.or.at>
  6. * @author Morris Jobke <hey@morrisjobke.de>
  7. * @author Roeland Jago Douma <roeland@famdouma.nl>
  8. * @author Thomas Tanghus <thomas@tanghus.net>
  9. * @author Vincent Petry <pvince81@owncloud.com>
  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. /**
  27. * Public interface of ownCloud for apps to use.
  28. * Tag manager interface
  29. *
  30. */
  31. // use OCP namespace for all classes that are considered public.
  32. // This means that they should be used by apps instead of the internal ownCloud classes
  33. namespace OCP;
  34. /**
  35. * Factory class creating instances of \OCP\ITags
  36. *
  37. * A tag can be e.g. 'Family', 'Work', 'Chore', 'Special Occation' or
  38. * anything else that is either parsed from a vobject or that the user chooses
  39. * to add.
  40. * Tag names are not case-sensitive, but will be saved with the case they
  41. * are entered in. If a user already has a tag 'family' for a type, and
  42. * tries to add a tag named 'Family' it will be silently ignored.
  43. * @since 6.0.0
  44. */
  45. interface ITagManager {
  46. /**
  47. * Create a new \OCP\ITags instance and load tags from db for the current user.
  48. *
  49. * @see \OCP\ITags
  50. * @param string $type The type identifier e.g. 'contact' or 'event'.
  51. * @param array $defaultTags An array of default tags to be used if none are stored.
  52. * @param boolean $includeShared Whether to include tags for items shared with this user by others.
  53. * @param string $userId user for which to retrieve the tags, defaults to the currently
  54. * logged in user
  55. * @return \OCP\ITags
  56. * @since 6.0.0 - parameter $includeShared and $userId were added in 8.0.0
  57. */
  58. public function load($type, $defaultTags = array(), $includeShared = false, $userId = null);
  59. }