Newer
Older
Dries Buytaert
committed
<?php
/**
* @file
Angie Byron
committed
* Definition of Drupal\taxonomy\Plugin\Core\Entity\Term.
Dries Buytaert
committed
*/
Angie Byron
committed
namespace Drupal\taxonomy\Plugin\Core\Entity;
Dries Buytaert
committed
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\Entity;
Angie Byron
committed
use Drupal\Core\Annotation\Plugin;
use Drupal\Core\Annotation\Translation;
Dries Buytaert
committed
/**
* Defines the taxonomy term entity.
Angie Byron
committed
*
* @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"
* },
Angie Byron
committed
* translation_controller_class = "Drupal\taxonomy\TermTranslationController",
Angie Byron
committed
* 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
* }
Angie Byron
committed
* },
* menu_base_path = "taxonomy/term/%taxonomy_term"
Angie Byron
committed
* )
Dries Buytaert
committed
*/
class Term extends Entity implements ContentEntityInterface {
Dries Buytaert
committed
/**
* The taxonomy term ID.
*
* @var integer
*/
public $tid;
Dries Buytaert
committed
/**
* The term UUID.
*
* @var string
*/
public $uuid;
Dries Buytaert
committed
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/**
* 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().
Dries Buytaert
committed
*/
public function id() {
return $this->tid;
}
/**
* Implements Drupal\Core\Entity\EntityInterface::bundle().
Dries Buytaert
committed
*/
public function bundle() {
return $this->vocabulary_machine_name;
}
}