function AttributeClassDiscovery::prepareAttributeDefinition

Same name in this branch
  1. 10 core/lib/Drupal/Core/Plugin/Discovery/AttributeClassDiscovery.php \Drupal\Core\Plugin\Discovery\AttributeClassDiscovery::prepareAttributeDefinition()
Same name in other branches
  1. 11.x core/lib/Drupal/Core/Plugin/Discovery/AttributeClassDiscovery.php \Drupal\Core\Plugin\Discovery\AttributeClassDiscovery::prepareAttributeDefinition()
  2. 11.x core/lib/Drupal/Component/Plugin/Discovery/AttributeClassDiscovery.php \Drupal\Component\Plugin\Discovery\AttributeClassDiscovery::prepareAttributeDefinition()

Prepares the attribute definition.

Parameters

\Drupal\Component\Plugin\Attribute\AttributeInterface $attribute: The attribute derived from the plugin.

string $class: The class used for the plugin.

2 calls to AttributeClassDiscovery::prepareAttributeDefinition()
AttributeClassDiscovery::parseClass in core/lib/Drupal/Component/Plugin/Discovery/AttributeClassDiscovery.php
Parses attributes from a class.
AttributeClassDiscovery::prepareAttributeDefinition in core/lib/Drupal/Core/Plugin/Discovery/AttributeClassDiscovery.php
Prepares the attribute definition.
1 method overrides AttributeClassDiscovery::prepareAttributeDefinition()
AttributeClassDiscovery::prepareAttributeDefinition in core/lib/Drupal/Core/Plugin/Discovery/AttributeClassDiscovery.php
Prepares the attribute definition.

File

core/lib/Drupal/Component/Plugin/Discovery/AttributeClassDiscovery.php, line 161

Class

AttributeClassDiscovery
Defines a discovery mechanism to find plugins with attributes.

Namespace

Drupal\Component\Plugin\Discovery

Code

protected function prepareAttributeDefinition(AttributeInterface $attribute, string $class) : void {
    $attribute->setClass($class);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.