You are here

protected function FlexiformFormEntityManager::initFormEntities in Flexiform 8

Initialize form entities.

2 calls to FlexiformFormEntityManager::initFormEntities()
FlexiformFormEntityManager::__construct in src/FormEntity/FlexiformFormEntityManager.php
Construct a new FlexiformFormEntityManager.
TempstoreAwareFlexiformFormEntityManager::initFormEntities in contrib/wizard/src/FormEntity/TempstoreAwareFormEntityManager.php
Initialize form entities.
1 method overrides FlexiformFormEntityManager::initFormEntities()
TempstoreAwareFlexiformFormEntityManager::initFormEntities in contrib/wizard/src/FormEntity/TempstoreAwareFormEntityManager.php
Initialize form entities.

File

src/FormEntity/FlexiformFormEntityManager.php, line 64

Class

FlexiformFormEntityManager
Class for form entity managers.

Namespace

Drupal\flexiform\FormEntity

Code

protected function initFormEntities(array $provided = []) {
  foreach ($this->formDisplay
    ->getFormEntityConfig() as $namespace => $configuration) {
    $configuration['manager'] = $this;
    $form_entity_plugin = $this
      ->getPluginManager()
      ->createInstance($configuration['plugin'], $configuration);
    if (isset($provided[$namespace])) {
      $this->contexts[$namespace] = FormEntityContext::createFromFlexiformFormEntity($form_entity_plugin, $provided[$namespace]);
    }
    else {
      $this->contexts[$namespace] = FormEntityContext::createFromFlexiformFormEntity($form_entity_plugin);
    }
    $this->contexts[$namespace]
      ->setEntityNamespace($namespace);
  }
}