FactoryInterface.php 763 Bytes
Newer Older
1 2 3
<?php
/**
 * @file
4
 * Contains \Drupal\Component\Plugin\Factory\FactoryInterface.
5 6 7 8 9 10 11 12 13 14
 */

namespace Drupal\Component\Plugin\Factory;

/**
 * Factory interface implemented by all plugin factories.
 */
interface FactoryInterface {

  /**
15
   * Creates a pre-configured instance of a plugin.
16 17
   *
   * @param string $plugin_id
18
   *   The ID of the plugin being instantiated.
19 20 21 22 23
   * @param array $configuration
   *   An array of configuration relevant to the plugin instance.
   *
   * @return object
   *   A fully configured plugin instance.
24 25 26
   *
   * @throws \Drupal\Component\Plugin\Exception\PluginException
   *   If the instance cannot be created, such as if the ID is invalid.
27
   */
28
  public function createInstance($plugin_id, array $configuration = array());
29 30

}