Skip to content
Taxonomy.php 711 B
Newer Older
 * Definition of Drupal\taxonomy\Plugin\views\argument\Taxonomy.
namespace Drupal\taxonomy\Plugin\views\argument;

use Drupal\views\Plugin\views\argument\Numeric;

/**
 * Argument handler for basic taxonomy tid.
 *
 * @ingroup views_argument_handlers
 */
class Taxonomy extends Numeric {

  /**
   * Override the behavior of title(). Get the title of the node.
   */
  function title() {
    // There might be no valid argument.
    if ($this->argument) {
      $term = entity_load('taxonomy_term', $this->argument);
        return check_plain($term->label());
      }
    }
    // TODO review text
    return t('No name');
  }