class Term

Same name in this branch

Defines the taxonomy term entity.

Plugin annotation


@Plugin(
  id = "taxonomy_term",
  label = @Translation("Taxonomy term"),
  module = "taxonomy",
  controller_class = "Drupal\taxonomy\TermStorageController",
  render_controller_class = "Drupal\taxonomy\TermRenderController",
  form_controller_class = {
    "default" = "Drupal\taxonomy\TermFormController"
  },
  translation_controller_class = "Drupal\taxonomy\TermTranslationController",
  base_table = "taxonomy_term_data",
  uri_callback = "taxonomy_term_uri",
  fieldable = TRUE,
  entity_keys = {
    "id" = "tid",
    "bundle" = "vocabulary_machine_name",
    "label" = "name",
    "uuid" = "uuid"
  },
  bundle_keys = {
    "bundle" = "machine_name"
  },
  view_modes = {
    "full" = {
      "label" = "Taxonomy term page",
      "custom_settings" = FALSE
    }
  },
  menu_base_path = "taxonomy/term/%taxonomy_term"
)

Hierarchy

Expanded class hierarchy of Term

6 files declare their use of Term
forum.module in drupal/core/modules/forum/forum.module
Provides discussion forums.
path.module in drupal/core/modules/path/path.module
Enables users to rename URLs.
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.

... See full list

2 string references to 'Term'

File

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

Namespace

Drupal\taxonomy\Plugin\Core\Entity
View source
class Term extends Entity implements ContentEntityInterface {

  /**
   * The taxonomy term ID.
   *
   * @var integer
   */
  public $tid;

  /**
   * The term UUID.
   *
   * @var string
   */
  public $uuid;

  /**
   * The taxonomy vocabulary ID this term belongs to.
   *
   * @var integer
   */
  public $vid;

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

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

  /**
   * The text format name for the term's description.
   *
   * @var string
   */
  public $format;

  /**
   * The weight of this term.
   *
   * This property stores the weight of this term in relation to other terms of
   * the same vocabulary.
   *
   * @var integer
   */
  public $weight = 0;

  /**
   * The parent term(s) for this term.
   *
   * This property is not loaded, but may be used to modify the term parents via
   * Term::save().
   *
   * The property can be set to an array of term IDs. An entry of 0 means this
   * term does not have any parents. When omitting this variable during an
   * update, the existing hierarchy for the term remains unchanged.
   *
   * @var array
   */
  public $parent;

  /**
   * The machine name of the vocabulary the term is assigned to.
   *
   * If not given, this value will be set automatically by loading the
   * vocabulary based on the $entity->vid property.
   *
   * @var string
   */
  public $vocabulary_machine_name;

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

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

}

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::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
Term::$description public property Description of the term.
Term::$format public property The text format name for the term's description.
Term::$name public property Name of the term.
Term::$parent public property The parent term(s) for this term.
Term::$tid public property The taxonomy term ID.
Term::$uuid public property The term UUID.
Term::$vid public property The taxonomy vocabulary ID this term belongs to.
Term::$vocabulary_machine_name public property The machine name of the vocabulary the term is assigned to.
Term::$weight public property The weight of this term.
Term::bundle public function Implements Drupal\Core\Entity\EntityInterface::bundle(). Overrides Entity::bundle
Term::id public function Implements Drupal\Core\Entity\EntityInterface::id(). Overrides Entity::id