You are here

abstract class SmartIpEventSubscriberBase in Smart IP 8.3

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

Provides a base class for Smart IP data source modules.

Hierarchy

Expanded class hierarchy of SmartIpEventSubscriberBase

6 files declare their use of SmartIpEventSubscriberBase
SmartIpEventSubscriber.php in modules/device_geolocation/src/EventSubscriber/SmartIpEventSubscriber.php
Contains \Drupal\device_geolocation\EventSubscriber\SmartIpEventSubscriber.
SmartIpEventSubscriber.php in modules/smart_ip_maxmind_geoip2_bin_db/src/EventSubscriber/SmartIpEventSubscriber.php
Contains \Drupal\smart_ip_maxmind_geoip2_bin_db\EventSubscriber\SmartIpEventSubscriber.
SmartIpEventSubscriber.php in modules/smart_ip_ipinfodb_web_service/src/EventSubscriber/SmartIpEventSubscriber.php
Contains \Drupal\smart_ip_ipinfodb_web_service\EventSubscriber\SmartIpEventSubscriber.
SmartIpEventSubscriber.php in modules/smart_ip_ip2location_bin_db/src/EventSubscriber/SmartIpEventSubscriber.php
Contains \Drupal\smart_ip_ip2location_bin_db\EventSubscriber\SmartIpEventSubscriber.
SmartIpEventSubscriber.php in modules/smart_ip_abstract_web_service/src/EventSubscriber/SmartIpEventSubscriber.php
Contains \Drupal\smart_ip_abstract_web_service\EventSubscriber\SmartIpEventSubscriber.

... See full list

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][] = [
      'processQuery',
    ];
    $events[SmartIpEvents::DISPLAY_SETTINGS][] = [
      'formSettings',
    ];
    $events[SmartIpEvents::VALIDATE_SETTINGS][] = [
      'validateFormSettings',
    ];
    $events[SmartIpEvents::SUBMIT_SETTINGS][] = [
      'submitFormSettings',
    ];
    $events[SmartIpEvents::GET_CONFIG_NAME][] = [
      'includeEditableConfigNames',
    ];
    $events[SmartIpEvents::MANUAL_UPDATE][] = [
      'manualUpdate',
    ];
    $events[SmartIpEvents::CRON_RUN][] = [
      '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. 6
SmartIpDataSourceInterface::cronRun public function Act on Drupal cron run. 6
SmartIpDataSourceInterface::formSettings public function Add the form elements of this Smart IP data source to main admin settings page of Smart IP. 6
SmartIpDataSourceInterface::manualUpdate public function Act on manual database update. 6
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. 6
SmartIpDataSourceInterface::sourceId public static function Smart IP data source module's source ID. 6
SmartIpDataSourceInterface::submitFormSettings public function Act on submission of main Smart IP admin settings form. 6
SmartIpDataSourceInterface::validateFormSettings public function Act on validation of main Smart IP admin settings form. 6
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