You are here

class ConfigRewriteInstallSubscriber in Configuration Rewrite 8.2

Class ConfigRewriteInstallSubscriber.

@package Drupal\config_rewrite

Hierarchy

Expanded class hierarchy of ConfigRewriteInstallSubscriber

1 string reference to 'ConfigRewriteInstallSubscriber'
config_rewrite.services.yml in ./config_rewrite.services.yml
config_rewrite.services.yml
1 service uses ConfigRewriteInstallSubscriber
config_rewrite.install_subscriber in ./config_rewrite.services.yml
Drupal\config_rewrite\EventSubscriber\ConfigRewriteInstallSubscriber

File

src/EventSubscriber/ConfigRewriteInstallSubscriber.php, line 15

Namespace

Drupal\config_rewrite\EventSubscriber
View source
class ConfigRewriteInstallSubscriber implements EventSubscriberInterface {

  /**
   * @var \Drupal\config_rewrite\ConfigRewriter
   */
  protected $configRewriter;

  /**
   * ConfigRewriteInstallSubscriber constructor.
   * @param \Drupal\config_rewrite\ConfigRewriter $config_rewriter
   */
  public function __construct(ConfigRewriter $config_rewriter) {
    $this->configRewriter = $config_rewriter;
  }

  /**
   * {@inheritdoc}
   */
  static function getSubscribedEvents() {
    $events[ModuleEvents::MODULE_INSTALLED][] = [
      'module_install_config_rewrite',
    ];
    return $events;
  }

  /**
   * @param \Symfony\Component\EventDispatcher\Event $event
   */
  public function module_install_config_rewrite(Event $event) {
    $this->configRewriter
      ->rewriteModuleConfig($event
      ->getModule());
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigRewriteInstallSubscriber::$configRewriter protected property
ConfigRewriteInstallSubscriber::getSubscribedEvents static function Returns an array of event names this subscriber wants to listen to.
ConfigRewriteInstallSubscriber::module_install_config_rewrite public function
ConfigRewriteInstallSubscriber::__construct public function ConfigRewriteInstallSubscriber constructor.