ContainerFactoryPluginInterface.php

Same filename in other branches
  1. 9 core/lib/Drupal/Core/Plugin/ContainerFactoryPluginInterface.php
  2. 8.9.x core/lib/Drupal/Core/Plugin/ContainerFactoryPluginInterface.php
  3. 11.x core/lib/Drupal/Core/Plugin/ContainerFactoryPluginInterface.php

Namespace

Drupal\Core\Plugin

File

core/lib/Drupal/Core/Plugin/ContainerFactoryPluginInterface.php

View source
<?php

namespace Drupal\Core\Plugin;

use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Defines an interface for pulling plugin dependencies from the container.
 */
interface ContainerFactoryPluginInterface {
    
    /**
     * Creates an instance of the plugin.
     *
     * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
     *   The container to pull out services used in the plugin.
     * @param array $configuration
     *   A configuration array containing information about the plugin instance.
     * @param string $plugin_id
     *   The plugin ID for the plugin instance.
     * @param mixed $plugin_definition
     *   The plugin implementation definition.
     *
     * @return static
     *   Returns an instance of this plugin.
     */
    public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition);

}

Interfaces

Title Deprecated Summary
ContainerFactoryPluginInterface Defines an interface for pulling plugin dependencies from the container.

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