ITagManager.php 2.2 KB

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