You are here

function IndexNameDepth::title in Views Taxonomy Term Name Depth 8

Same name and namespace in other branches
  1. 8.6 src/Plugin/views/argument/IndexNameDepth.php \Drupal\views_taxonomy_term_name_depth\Plugin\views\argument\IndexNameDepth::title()
  2. 8.3 src/Plugin/views/argument/IndexNameDepth.php \Drupal\views_taxonomy_term_name_depth\Plugin\views\argument\IndexNameDepth::title()
  3. 7.x src/Plugin/views/argument/IndexNameDepth.php \Drupal\views_taxonomy_term_name_depth\Plugin\views\argument\IndexNameDepth::title()

Get the title this argument will assign the view, given the argument.

This usually needs to be overridden to provide a proper title.

Overrides ArgumentPluginBase::title

File

src/Plugin/views/argument/IndexNameDepth.php, line 150

Class

IndexNameDepth
Argument handler for taxonomy terms with depth.

Namespace

Drupal\views_taxonomy_term_name_depth\Plugin\views\argument

Code

function title() {
  $term = $this->termStorage
    ->load($this->argument);
  if (!empty($term)) {
    return $term
      ->getName();
  }

  // TODO review text
  return $this
    ->t('No name');
}