ConfigImportValidateEventSubscriberBase.php 786 Bytes
Newer Older
1 2 3 4
<?php

namespace Drupal\Core\Config;

5
use Drupal\Core\StringTranslation\StringTranslationTrait;
6 7 8 9 10 11
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

/**
 * Defines a base event listener implementation for config sync validation.
 */
abstract class ConfigImportValidateEventSubscriberBase implements EventSubscriberInterface {
12
  use StringTranslationTrait;
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

  /**
   * Checks that the configuration synchronization is valid.
   *
   * @param ConfigImporterEvent $event
   *   The config import event.
   */
  abstract public function onConfigImporterValidate(ConfigImporterEvent $event);

  /**
   * {@inheritdoc}
   */
  static function getSubscribedEvents() {
    $events[ConfigEvents::IMPORT_VALIDATE][] = array('onConfigImporterValidate', 20);
    return $events;
  }

}