VocabularyInterface.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace Drupal\taxonomy;
  3. use Drupal\Core\Config\Entity\ConfigEntityInterface;
  4. /**
  5. * Provides an interface defining a taxonomy vocabulary entity.
  6. */
  7. interface VocabularyInterface extends ConfigEntityInterface {
  8. /**
  9. * Denotes that no term in the vocabulary has a parent.
  10. */
  11. const HIERARCHY_DISABLED = 0;
  12. /**
  13. * Denotes that one or more terms in the vocabulary has a single parent.
  14. */
  15. const HIERARCHY_SINGLE = 1;
  16. /**
  17. * Denotes that one or more terms in the vocabulary have multiple parents.
  18. */
  19. const HIERARCHY_MULTIPLE = 2;
  20. /**
  21. * Returns the vocabulary hierarchy.
  22. *
  23. * @return int
  24. * The vocabulary hierarchy.
  25. */
  26. public function getHierarchy();
  27. /**
  28. * Sets the vocabulary hierarchy.
  29. *
  30. * @param int $hierarchy
  31. * The hierarchy type of vocabulary.
  32. * Possible values:
  33. * - VocabularyInterface::HIERARCHY_DISABLED: No parents.
  34. * - VocabularyInterface::HIERARCHY_SINGLE: Single parent.
  35. * - VocabularyInterface::HIERARCHY_MULTIPLE: Multiple parents.
  36. *
  37. * @return $this
  38. */
  39. public function setHierarchy($hierarchy);
  40. /**
  41. * Returns the vocabulary description.
  42. *
  43. * @return string
  44. * The vocabulary description.
  45. */
  46. public function getDescription();
  47. }