class TypedConfigElementFactory

A factory for typed config element objects.

This factory merges the type definition into the element definition prior to creating the instance.

Hierarchy

Expanded class hierarchy of TypedConfigElementFactory

File

drupal/core/lib/Drupal/Core/Config/TypedConfigElementFactory.php, line 18
Contains \Drupal\Core\Config\TypedConfigElementFactory.

Namespace

Drupal\Core\Config
View source
class TypedConfigElementFactory extends TypedDataFactory {

  /**
   * Overrides Drupal\Core\TypedData\TypedDataFactory::createInstance().
   */
  public function createInstance($plugin_id, array $configuration, $name = NULL, $parent = NULL) {
    $type_definition = $this->discovery
      ->getDefinition($plugin_id);
    $configuration += $type_definition;
    return parent::createInstance($plugin_id, $configuration, $name, $parent);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DefaultFactory::$discovery protected property The object that retrieves the definitions of the plugins that this factory instantiates.
DefaultFactory::getPluginClass public static function Finds the class relevant for a given plugin.
DefaultFactory::__construct public function Constructs a Drupal\Component\Plugin\Factory\DefaultFactory object.
TypedConfigElementFactory::createInstance public function Overrides Drupal\Core\TypedData\TypedDataFactory::createInstance(). Overrides TypedDataFactory::createInstance