You are here

public function ConfigProviderOptional::addConfigToCreate in Configuration Provider 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/ConfigProvider/ConfigProviderOptional.php \Drupal\config_provider\Plugin\ConfigProvider\ConfigProviderOptional::addConfigToCreate()

Adds configuration to be installed.

This method is invoked at extension install time. A given configuration provider can add configuration to be installed or alter configuration as provided by a prior extension.

In some cases, installation of configuration may be handled separately, meaning that no configuration need be added here.

Parameters

StorageInterface $storage: The configuration storage to read configuration from.

string $collection: The configuration collection to use.

string $prefix: (optional) Limit to configuration starting with the provided string.

\Drupal\Core\Config\StorageInterface[] $profile_storages: An array of storage interfaces containing profile configuration to check for overrides.

Return value

array An array of configuration data read from the source storage keyed by the configuration object name.

Overrides ConfigProviderInterface::addConfigToCreate

See also

\Drupal\config_provider\ConfigProviderConfigInstaller::getConfigToCreate()

\Drupal\config_provider\Plugin\ConfigProviderInterface\addInstallableConfig()

File

src/Plugin/ConfigProvider/ConfigProviderOptional.php, line 32

Class

ConfigProviderOptional
Class for providing configuration from an install directory.

Namespace

Drupal\config_provider\Plugin\ConfigProvider

Code

public function addConfigToCreate(array &$config_to_create, StorageInterface $storage, $collection, $prefix = '', array $profile_storages = []) {

  // Optional configuration is installed subsequently, so we can't add it
  // here.
}