You are here

abstract class SmartIpEventSubscriberBase in Smart IP 8.2

Same name and namespace in other branches
  1. 8.4 src/SmartIpEventSubscriberBase.php \Drupal\smart_ip\SmartIpEventSubscriberBase
  2. 8.3 src/SmartIpEventSubscriberBase.php \Drupal\smart_ip\SmartIpEventSubscriberBase

Provides a base class for Smart IP data source modules.

Hierarchy

Expanded class hierarchy of SmartIpEventSubscriberBase

1 file declares its use of SmartIpEventSubscriberBase
SmartIpEventSubscriber.php in modules/smart_ip_ipinfodb_web_service/src/EventSubscriber/SmartIpEventSubscriber.php
Contains \Drupal\smart_ip_ipinfodb_web_service\EventSubscriber\SmartIpEventSubscriber.

File

src/SmartIpEventSubscriberBase.php, line 15
Contains \Drupal\smart_ip\SmartIpEventSubscriberBase.

Namespace

Drupal\smart_ip
View source
abstract class SmartIpEventSubscriberBase implements EventSubscriberInterface, SmartIpDataSourceInterface {

  /**
   * {@inheritdoc}
   */
  public function includeEditableConfigNames(AdminSettingsEvent $event) {
    $configNames = $event
      ->getEditableConfigNames();
    $configNames[] = $this
      ->configName();
    $event
      ->setEditableConfigNames($configNames);
  }

  /**
   * {@inheritdoc}
   */
  static function getSubscribedEvents() {
    $events[SmartIpEvents::QUERY_IP][] = array(
      'processQuery',
    );
    $events[SmartIpEvents::DISPLAY_SETTINGS][] = array(
      'formSettings',
    );
    $events[SmartIpEvents::VALIDATE_SETTINGS][] = array(
      'validateFormSettings',
    );
    $events[SmartIpEvents::SUBMIT_SETTINGS][] = array(
      'submitFormSettings',
    );
    $events[SmartIpEvents::GET_CONFIG_NAME][] = array(
      'includeEditableConfigNames',
    );
    $events[SmartIpEvents::MANUAL_UPDATE][] = array(
      'manualUpdate',
    );
    $events[SmartIpEvents::CRON_RUN][] = array(
      'cronRun',
    );
    return $events;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SmartIpDataSourceInterface::configName public static function Get the config name of this Smart IP data source module. 1
SmartIpDataSourceInterface::cronRun public function Act on Drupal cron run. 1
SmartIpDataSourceInterface::formSettings public function Add the form elements of this Smart IP data source to main admin settings page of Smart IP. 1
SmartIpDataSourceInterface::manualUpdate public function Act on manual database update. 1
SmartIpDataSourceInterface::processQuery public function Act on \Drupal\smart_ip\SmartIp::query() when executed and if selected as Smart IP data source, query the IP address against its database. 1
SmartIpDataSourceInterface::sourceId public static function Smart IP data source module's source ID. 1
SmartIpDataSourceInterface::submitFormSettings public function Act on submission of main Smart IP admin settings form. 1
SmartIpDataSourceInterface::validateFormSettings public function Act on validation of main Smart IP admin settings form. 1
SmartIpEventSubscriberBase::getSubscribedEvents static function Returns an array of event names this subscriber wants to listen to.
SmartIpEventSubscriberBase::includeEditableConfigNames public function Add Smart IP source module's config name. Overrides SmartIpDataSourceInterface::includeEditableConfigNames