interface IconExtractorInterface

Interface for icon_extractor plugins.

@internal This API is experimental.

Hierarchy

Expanded class hierarchy of IconExtractorInterface

All classes that implement IconExtractorInterface

File

core/lib/Drupal/Core/Theme/Icon/IconExtractorInterface.php, line 15

Namespace

Drupal\Core\Theme\Icon
View source
interface IconExtractorInterface extends PluginFormInterface {
    
    /**
     * Get a list of all the icons discovered by this extractor.
     *
     * The icons must be provided as an associative array keyed by the icon id
     * with values used to load the icon: source and group.
     *
     * @return array
     *   List of icons that are found by this extractor. Keyed by icon full id.
     */
    public function discoverIcons() : array;
    
    /**
     * Load an icon object.
     *
     * @param array $icon_data
     *   The icon data build in the discoverIcons() method.
     *
     * @return \Drupal\Core\Theme\Icon\IconDefinitionInterface|null
     *   The icon.
     */
    public function loadIcon(array $icon_data) : ?IconDefinitionInterface;
    
    /**
     * Returns the translated plugin label.
     */
    public function label() : string;
    
    /**
     * Returns the translated plugin description.
     */
    public function description() : string;
    
    /**
     * Create the icon definition from an extractor plugin.
     *
     * @param string $icon_id
     *   The id of the icon.
     * @param string|null $source
     *   The source, url or path of the icon.
     * @param string|null $group
     *   The group of the icon.
     * @param array|null $data
     *   The icon data.
     *
     * @return \Drupal\Core\Theme\Icon\IconDefinitionInterface
     *   The icon definition.
     *
     * @see \Drupal\Core\Theme\Icon\IconDefinition::create()
     */
    public function createIcon(string $icon_id, ?string $source = NULL, ?string $group = NULL, ?array $data = NULL) : IconDefinitionInterface;

}

Members

Title Sort descending Modifiers Object type Summary Overrides
IconExtractorInterface::createIcon public function Create the icon definition from an extractor plugin. 1
IconExtractorInterface::description public function Returns the translated plugin description. 1
IconExtractorInterface::discoverIcons public function Get a list of all the icons discovered by this extractor. 5
IconExtractorInterface::label public function Returns the translated plugin label. 1
IconExtractorInterface::loadIcon public function Load an icon object. 1
PluginFormInterface::buildConfigurationForm public function Form constructor. 33
PluginFormInterface::submitConfigurationForm public function Form submission handler. 31
PluginFormInterface::validateConfigurationForm public function Form validation handler. 17

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