Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Node.php

function Node::getNode

Parameters

string|int $name:

31 calls to Node::getNode()
AbstractUnary::compile in vendor/twig/twig/src/Node/Expression/Unary/AbstractUnary.php
ArrowFunctionExpression::compile in vendor/twig/twig/src/Node/Expression/ArrowFunctionExpression.php
AutoEscapeNode::compile in vendor/twig/twig/src/Node/AutoEscapeNode.php
CallExpression::compileArguments in vendor/twig/twig/src/Node/Expression/CallExpression.php
CheckToStringNode::compile in vendor/twig/twig/src/Node/CheckToStringNode.php

... See full list

File

vendor/twig/twig/src/Node/Node.php, line 200

Class

Node
Represents a node in the AST.

Namespace

Twig\Node

Code

public function getNode(string $name) : self {
    if (!isset($this->nodes[$name])) {
        throw new \LogicException(\sprintf('Node "%s" does not exist for Node "%s".', $name, static::class));
    }
    $triggerDeprecation = \func_num_args() > 1 ? func_get_arg(1) : true;
    if ($triggerDeprecation && isset($this->nodeNameDeprecations[$name])) {
        $dep = $this->nodeNameDeprecations[$name];
        if ($dep->getNewName()) {
            trigger_deprecation($dep->getPackage(), $dep->getVersion(), 'Getting node "%s" on a "%s" class is deprecated, get the "%s" node instead.', $name, static::class, $dep->getNewName());
        }
        else {
            trigger_deprecation($dep->getPackage(), $dep->getVersion(), 'Getting node "%s" on a "%s" class is deprecated.', $name, static::class);
        }
    }
    return $this->nodes[$name];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal