interface AttributeInterface

Same name in other branches
  1. 10 core/lib/Drupal/Component/Plugin/Attribute/AttributeInterface.php \Drupal\Component\Plugin\Attribute\AttributeInterface

Defines a common interface for classed attributes.

Hierarchy

Expanded class hierarchy of AttributeInterface

All classes that implement AttributeInterface

4 files declare their use of AttributeInterface
AttributeClassDiscovery.php in core/lib/Drupal/Core/Plugin/Discovery/AttributeClassDiscovery.php
AttributeClassDiscovery.php in core/lib/Drupal/Component/Plugin/Discovery/AttributeClassDiscovery.php
DefaultPluginManager.php in core/lib/Drupal/Core/Plugin/DefaultPluginManager.php
MigratePluginManager.php in core/modules/migrate/src/Plugin/MigratePluginManager.php

File

core/lib/Drupal/Component/Plugin/Attribute/AttributeInterface.php, line 8

Namespace

Drupal\Component\Plugin\Attribute
View source
interface AttributeInterface {
    
    /**
     * Gets the value of an attribute.
     */
    public function get() : mixed;
    
    /**
     * Gets the name of the provider of the attribute class.
     *
     * @return string|null
     */
    public function getProvider() : ?string;
    
    /**
     * Sets the name of the provider of the attribute class.
     *
     * @param string $provider
     *   The provider of the annotated class.
     */
    public function setProvider(string $provider) : void;
    
    /**
     * Gets the unique ID for this attribute class.
     *
     * @return string
     */
    public function getId() : string;
    
    /**
     * Gets the class of the attribute class.
     *
     * @return class-string|null
     */
    public function getClass() : ?string;
    
    /**
     * Sets the class of the attributed class.
     *
     * @param class-string $class
     *   The class of the attributed class.
     */
    public function setClass(string $class) : void;

}

Members

Title Sort descending Modifiers Object type Summary Overrides
AttributeInterface::get public function Gets the value of an attribute. 1
AttributeInterface::getClass public function Gets the class of the attribute class. 1
AttributeInterface::getId public function Gets the unique ID for this attribute class. 1
AttributeInterface::getProvider public function Gets the name of the provider of the attribute class. 1
AttributeInterface::setClass public function Sets the class of the attributed class. 1
AttributeInterface::setProvider public function Sets the name of the provider of the attribute class. 1

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