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

Breadcrumb

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

function Node::getAttribute

Same name in this branch
  1. 11.1.x vendor/phpstan/phpdoc-parser/src/Ast/Node.php \PHPStan\PhpDocParser\Ast\Node::getAttribute()
  2. 11.1.x vendor/nikic/php-parser/lib/PhpParser/Node.php \PhpParser\Node::getAttribute()
35 calls to Node::getAttribute()
AbstractExpression::hasExplicitParentheses in vendor/twig/twig/src/Node/Expression/AbstractExpression.php
AbstractExpression::isGenerator in vendor/twig/twig/src/Node/Expression/AbstractExpression.php
AssignTemplateVariable::compile in vendor/twig/twig/src/Node/Expression/Variable/AssignTemplateVariable.php
BlockReferenceExpression::compile in vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php
BlockReferenceNode::compile in vendor/twig/twig/src/Node/BlockReferenceNode.php

... See full list

File

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

Class

Node
Represents a node in the AST.

Namespace

Twig\Node

Code

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

API Navigation

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