Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 10 |
Term | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
20 | |
0.00% |
0 / 10 |
init | |
0.00% |
0 / 1 |
20 | |
0.00% |
0 / 10 |
<?php | |
/** | |
* @file | |
* Contains \Drupal\taxonomy\Plugin\views\argument_validator\Term. | |
*/ | |
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; | |
} | |
} | |
} | |
} | |
} |