class Vocabulary

Defines the taxonomy vocabulary entity.

Plugin annotation


@Plugin(
  id = "taxonomy_vocabulary",
  label = @Translation("Taxonomy vocabulary"),
  module = "taxonomy",
  controller_class = "Drupal\taxonomy\VocabularyStorageController",
  form_controller_class = {
    "default" = "Drupal\taxonomy\VocabularyFormController"
  },
  base_table = "taxonomy_vocabulary",
  entity_keys = {
    "id" = "vid",
    "label" = "name"
  },
  view_modes = {
    "full" = {
      "label" = "Taxonomy vocabulary",
      "custom_settings" = FALSE
    }
  }
)

Hierarchy

Expanded class hierarchy of Vocabulary

3 files declare their use of Vocabulary
taxonomy.admin.inc in drupal/core/modules/taxonomy/taxonomy.admin.inc
Administrative page callbacks for the taxonomy module.
taxonomy.module in drupal/core/modules/taxonomy/taxonomy.module
Enables the organization of content into categories.
taxonomy.pages.inc in drupal/core/modules/taxonomy/taxonomy.pages.inc
Page callbacks for the taxonomy module.
4 string references to 'Vocabulary'
TaxonomyIndexTid::buildExtraOptionsForm in drupal/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/filter/TaxonomyIndexTid.php
Provide a form for setting options.
taxonomy_field_settings_form in drupal/core/modules/taxonomy/taxonomy.module
Implements hook_field_settings_form().
taxonomy_token_info in drupal/core/modules/taxonomy/taxonomy.tokens.inc
Implements hook_token_info().
taxonomy_views_data in drupal/core/modules/taxonomy/taxonomy.views.inc
Implements hook_views_data().

File

drupal/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Core/Entity/Vocabulary.php, line 38
Definition of Drupal\taxonomy\Plugin\Core\Entity\Vocabulary.

Namespace

Drupal\taxonomy\Plugin\Core\Entity
View source
class Vocabulary extends Entity {

  /**
   * The taxonomy vocabulary ID.
   *
   * @var integer
   */
  public $vid;

  /**
   * Name of the vocabulary.
   *
   * @var string
   */
  public $name;

  /**
   * The vocabulary machine name.
   *
   * @var string
   */
  public $machine_name;

  /**
   * Description of the vocabulary.
   *
   * @var string
   */
  public $description;

  /**
   * The type of hierarchy allowed within the vocabulary.
   *
   * Possible values:
   * - TAXONOMY_HIERARCHY_DISABLED: No parents.
   * - TAXONOMY_HIERARCHY_SINGLE: Single parent.
   * - TAXONOMY_HIERARCHY_MULTIPLE: Multiple parents.
   *
   * @var integer
   */
  public $hierarchy = TAXONOMY_HIERARCHY_DISABLED;

  /**
   * The weight of this vocabulary in relation to other vocabularies.
   *
   * @var integer
   */
  public $weight = 0;

  /**
   * Implements Drupal\Core\Entity\EntityInterface::id().
   */
  public function id() {
    return $this->vid;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Entity::$enforceIsNew protected property Boolean indicating whether the entity should be forced to be new.
Entity::$entityType protected property The entity type.
Entity::$isDefaultRevision protected property Indicates whether this is the default revision. 1
Entity::$langcode public property The language code of the entity's default language. 4
Entity::$newRevision protected property Boolean indicating whether a new revision should be created on save.
Entity::access public function Implements AccessibleInterface::access(). Overrides AccessibleInterface::access
Entity::bundle public function Implements EntityInterface::bundle(). Overrides EntityInterface::bundle 4
Entity::createDuplicate public function Implements EntityInterface::createDuplicate(). Overrides EntityInterface::createDuplicate 3
Entity::delete public function Implements EntityInterface::delete(). Overrides EntityInterface::delete
Entity::enforceIsNew public function Implements EntityInterface::enforceIsNew(). Overrides EntityInterface::enforceIsNew
Entity::entityInfo public function Implements EntityInterface::entityInfo(). Overrides EntityInterface::entityInfo
Entity::entityType public function Implements EntityInterface::entityType(). Overrides EntityInterface::entityType
Entity::get public function Implements EntityInterface::get(). Overrides ComplexDataInterface::get 2
Entity::getIterator public function Implements ComplexDataInterface::getIterator(). 1
Entity::getProperties public function Implements ComplexDataInterface::getProperties(). Overrides ComplexDataInterface::getProperties 1
Entity::getPropertyDefinition public function Implements ComplexDataInterface::getPropertyDefinition(). Overrides ComplexDataInterface::getPropertyDefinition 1
Entity::getPropertyDefinitions public function Implements ComplexDataInterface::getPropertyDefinitions(). Overrides ComplexDataInterface::getPropertyDefinitions 1
Entity::getPropertyValues public function Implements ComplexDataInterface::getPropertyValues(). Overrides ComplexDataInterface::getPropertyValues 1
Entity::getRevisionId public function Implements Drupal\Core\Entity\EntityInterface::getRevisionId(). Overrides EntityInterface::getRevisionId 3
Entity::getTranslation public function Implements TranslatableInterface::getTranslation(). Overrides TranslatableInterface::getTranslation 1
Entity::getTranslationLanguages public function Implements TranslatableInterface::getTranslationLanguages(). Overrides TranslatableInterface::getTranslationLanguages 1
Entity::isDefaultRevision public function Implements Drupal\Core\Entity\EntityInterface::isDefaultRevision(). Overrides EntityInterface::isDefaultRevision 1
Entity::isEmpty public function Implements ComplexDataInterface::isEmpty(). Overrides ComplexDataInterface::isEmpty 1
Entity::isNew public function Implements EntityInterface::isNew(). Overrides EntityInterface::isNew 1
Entity::isNewRevision public function Implements EntityInterface::isNewRevision(). Overrides EntityInterface::isNewRevision
Entity::label public function Implements EntityInterface::label(). Overrides EntityInterface::label 1
Entity::language public function Implements TranslatableInterface::language(). Overrides TranslatableInterface::language 1
Entity::save public function Implements EntityInterface::save(). Overrides EntityInterface::save 3
Entity::set public function Implements ComplexDataInterface::set(). Overrides ComplexDataInterface::set 2
Entity::setNewRevision public function Implements EntityInterface::setNewRevision(). Overrides EntityInterface::setNewRevision
Entity::setPropertyValues public function Implements ComplexDataInterface::setPropertyValues(). Overrides ComplexDataInterface::setPropertyValues 1
Entity::translations public function Returns the languages the entity is translated to.
Entity::uri public function Implements EntityInterface::uri(). Overrides EntityInterface::uri 1
Entity::uuid public function Implements EntityInterface::uuid(). Overrides EntityInterface::uuid 1
Entity::__construct public function Constructs an Entity object. 2
Vocabulary::$description public property Description of the vocabulary.
Vocabulary::$hierarchy public property The type of hierarchy allowed within the vocabulary.
Vocabulary::$machine_name public property The vocabulary machine name.
Vocabulary::$name public property Name of the vocabulary.
Vocabulary::$vid public property The taxonomy vocabulary ID.
Vocabulary::$weight public property The weight of this vocabulary in relation to other vocabularies.
Vocabulary::id public function Implements Drupal\Core\Entity\EntityInterface::id(). Overrides Entity::id