Term.php

Same filename in this branch
  1. 8.9.x core/modules/taxonomy/src/Entity/Term.php
  2. 8.9.x core/modules/taxonomy/src/Plugin/migrate/source/d6/Term.php
  3. 8.9.x core/modules/taxonomy/src/Plugin/migrate/source/Term.php
  4. 8.9.x core/modules/taxonomy/src/Plugin/migrate/source/d7/Term.php
Same filename in other branches
  1. 9 core/modules/taxonomy/src/Entity/Term.php
  2. 9 core/modules/taxonomy/src/Plugin/views/argument_validator/Term.php
  3. 9 core/modules/taxonomy/src/Plugin/migrate/source/d6/Term.php
  4. 9 core/modules/taxonomy/src/Plugin/migrate/source/d7/Term.php
  5. 10 core/modules/taxonomy/src/Entity/Term.php
  6. 10 core/modules/taxonomy/src/Plugin/migrate/source/d6/Term.php
  7. 10 core/modules/taxonomy/src/Plugin/migrate/source/d7/Term.php
  8. 11.x core/modules/taxonomy/src/Entity/Term.php
  9. 11.x core/modules/taxonomy/src/Plugin/migrate/source/d6/Term.php
  10. 11.x core/modules/taxonomy/src/Plugin/migrate/source/d7/Term.php

Namespace

Drupal\taxonomy\Plugin\views\argument_validator

File

core/modules/taxonomy/src/Plugin/views/argument_validator/Term.php

View source
<?php

namespace Drupal\taxonomy\Plugin\views\argument_validator;

use Drupal\views\ViewExecutable;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\argument_validator\Entity;

/**
 * Adds legacy vocabulary handling to standard Entity Argument validation..
 */
class Term extends Entity {
    
    /**
     * {@inheritdoc}
     */
    public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
        parent::init($view, $display, $options);
        // @todo Remove the legacy code.
        // 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;
                }
            }
        }
    }

}

Classes

Title Deprecated Summary
Term Adds legacy vocabulary handling to standard Entity Argument validation..

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.