Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 7 |
IndexTid | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 7 |
titleQuery | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 7 |
<?php | |
/** | |
* @file | |
* Contains \Drupal\taxonomy\Plugin\views\argument\IndexTid. | |
*/ | |
namespace Drupal\taxonomy\Plugin\views\argument; | |
use Drupal\taxonomy\Entity\Term; | |
use Drupal\views\Plugin\views\argument\ManyToOne; | |
/** | |
* Allow taxonomy term ID(s) as argument. | |
* | |
* @ingroup views_argument_handlers | |
* | |
* @ViewsArgument("taxonomy_index_tid") | |
*/ | |
class IndexTid extends ManyToOne { | |
public function titleQuery() { | |
$titles = array(); | |
$terms = Term::loadMultiple($this->value); | |
foreach ($terms as $term) { | |
$titles[] = \Drupal::entityManager()->getTranslationFromContext($term)->label(); | |
} | |
return $titles; | |
} | |
} |