function DefaultFactory::__construct

Same name in other branches
  1. 8.9.x core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php \Drupal\Component\Plugin\Factory\DefaultFactory::__construct()
  2. 10 core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php \Drupal\Component\Plugin\Factory\DefaultFactory::__construct()
  3. 11.x core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php \Drupal\Component\Plugin\Factory\DefaultFactory::__construct()

Constructs a Drupal\Component\Plugin\Factory\DefaultFactory object.

Parameters

\Drupal\Component\Plugin\Discovery\DiscoveryInterface $discovery: The plugin discovery.

string|null $plugin_interface: (optional) The interface each plugin should implement.

File

core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php, line 44

Class

DefaultFactory
Default plugin factory.

Namespace

Drupal\Component\Plugin\Factory

Code

public function __construct(DiscoveryInterface $discovery, $plugin_interface = NULL) {
    $this->discovery = $discovery;
    $this->interface = $plugin_interface;
}

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