function 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.
Overrides AttributeClassDiscovery::prepareAttributeDefinition
File
-
core/
lib/ Drupal/ Core/ Plugin/ Discovery/ AttributeClassDiscovery.php, line 65
Class
- AttributeClassDiscovery
- Defines a discovery mechanism to find plugins using attributes.
Namespace
Drupal\Core\Plugin\DiscoveryCode
protected function prepareAttributeDefinition(AttributeInterface $attribute, string $class) : void {
parent::prepareAttributeDefinition($attribute, $class);
if (!$attribute->getProvider()) {
$attribute->setProvider($this->getProviderFromNamespace($class));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.