You are here

public function EventSubscriber::addCollections in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/config/tests/config_collection_install_test/src/EventSubscriber.php \Drupal\config_collection_install_test\EventSubscriber::addCollections()

Reacts to the ConfigEvents::COLLECTION_INFO event.

Parameters

\Drupal\Core\Config\ConfigCollectionInfo $collection_info: The configuration collection info event.

File

core/modules/config/tests/config_collection_install_test/src/EventSubscriber.php, line 35

Class

EventSubscriber

Namespace

Drupal\config_collection_install_test

Code

public function addCollections(ConfigCollectionInfo $collection_info) {
  $collections = $this->state
    ->get('config_collection_install_test.collection_names', []);
  foreach ($collections as $collection) {
    $collection_info
      ->addCollection($collection);
  }
}