Nid.php

Definition of Drupal\node\Plugin\views\argument\Nid.

Namespace

Drupal\node\Plugin\views\argument

File

drupal/core/modules/node/lib/Drupal/node/Plugin/views/argument/Nid.php
View source
<?php

/**
 * @file
 * Definition of Drupal\node\Plugin\views\argument\Nid.
 */
namespace Drupal\node\Plugin\views\argument;

use Drupal\views\Plugin\views\argument\Numeric;
use Drupal\Component\Annotation\PluginID;

/**
 * Argument handler to accept a node id.
 *
 * @PluginID("node_nid")
 */
class Nid extends Numeric {

  /**
   * Override the behavior of title(). Get the title of the node.
   */
  public function titleQuery() {
    $titles = array();
    $nodes = node_load_multiple($this->value);
    foreach ($nodes as $node) {
      $titles[] = check_plain($node
        ->label());
    }
    return $titles;
  }

}

Classes

Namesort descending Description
Nid Argument handler to accept a node id.