public function NodeTermData::init in Views (for Drupal 7) 8.3
Init handler to let relationships live on tables other than the table they operate on.
Overrides RelationshipPluginBase::init
File
- lib/
Views/ taxonomy/ Plugin/ views/ relationship/ NodeTermData.php, line 26 - Definition of Views\taxonomy\Plugin\views\relationship\NodeTermData.
Class
- NodeTermData
- Relationship handler to return the taxonomy terms of nodes.
Namespace
Views\taxonomy\Plugin\views\relationshipCode
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
// Convert legacy vids option to machine name vocabularies.
if (!empty($this->options['vids'])) {
$vocabularies = taxonomy_vocabulary_get_names();
foreach ($this->options['vids'] as $vid) {
if (isset($vocabularies[$vid], $vocabularies[$vid]->machine_name)) {
$this->options['vocabularies'][$vocabularies[$vid]->machine_name] = $vocabularies[$vid]->machine_name;
}
}
}
}