You are here

LanguageHierarchyConfigEventSubscriber.php in Language Hierarchy 2.x

Same filename and directory in other branches
  1. 8 src/EventSubscriber/LanguageHierarchyConfigEventSubscriber.php

File

src/EventSubscriber/LanguageHierarchyConfigEventSubscriber.php
View source
<?php

namespace Drupal\language_hierarchy\EventSubscriber;

use Drupal\Core\Config\ConfigEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\EventDispatcher\Event;

/**
 * Class LanguageHierarchyConfigEventSubscriber.
 *
 * @package Drupal\language_hierarchy
 */
class LanguageHierarchyConfigEventSubscriber implements EventSubscriberInterface {

  /**
   * This method is called when the config.importer.import event is dispatched.
   *
   * @param \Symfony\Component\EventDispatcher\Event $event
   *   The config import event.
   */
  public function onConfigImport(Event $event) {
    language_hierarchy_update_priorities();
  }

  /**
   * {@inheritdoc}
   */
  public static function getSubscribedEvents() {
    $events[ConfigEvents::IMPORT] = [
      'onConfigImport',
    ];
    return $events;
  }

}

Classes

Namesort descending Description
LanguageHierarchyConfigEventSubscriber Class LanguageHierarchyConfigEventSubscriber.