You are here

public function FieldInstanceConfigurationHandler::onLoadFromDatabaseEntity in Configuration Management 7.3

File

src/Handlers/FieldInstanceConfigurationHandler.php, line 114

Class

FieldInstanceConfigurationHandler

Namespace

Configuration\Handlers

Code

public function onLoadFromDatabaseEntity($event) {
  $entity_type = $event
    ->getSetting('entity_type');
  $bundle_name = $event
    ->getSetting('bundle_name');
  $entity_info = $this->configuration_manager
    ->drupal()
    ->entity_get_info($entity_type);
  if (!empty($entity_info['fieldable'])) {
    foreach (array_keys($this->configuration_manager
      ->drupal()
      ->field_info_instances($entity_type, $bundle_name)) as $field_instance) {
      $id = "field_instance.{$entity_type}.{$bundle_name}.{$field_instance}";
      $this->configuration_manager
        ->newPart($event->configuration, $id);
    }
  }
}