You are here

public function FieldBaseConfigurationHandler::loadFromDatabase in Configuration Management 7.3

Loads the configuration from the database.

Parameters

string $identifier: The identifier of the configuration to load.

Return value

\Configuration\Configuration A configuration object.

Overrides ConfigurationHandler::loadFromDatabase

File

src/Handlers/FieldBaseConfigurationHandler.php, line 26

Class

FieldBaseConfigurationHandler

Namespace

Configuration\Handlers

Code

public function loadFromDatabase($identifier) {
  $field_name = $this
    ->getInternalId($identifier);
  $field_info = $this->configuration_manager
    ->drupal()
    ->field_info_field($field_name);
  $configuration = new Configuration();
  $configuration
    ->setIdentifier($identifier);
  if (empty($field_info)) {
  }
  else {
    unset($field_info['id']);
    unset($field_info['bundles']);
    $configuration
      ->setData($field_info);
    $configuration
      ->addModule($field_info['storage']['module']);
    $configuration
      ->addModule($field_info['module']);
  }
  $event = $this
    ->triggerEvent('load_from_database', $configuration);
  return $event->configuration;
}