You are here

public static function SearchApiSubscriber::getSubscribedEvents in Facets 8

Same name in this branch
  1. 8 src/EventSubscriber/SearchApiSubscriber.php \Drupal\facets\EventSubscriber\SearchApiSubscriber::getSubscribedEvents()
  2. 8 modules/facets_summary/src/EventSubscriber/SearchApiSubscriber.php \Drupal\facets_summary\EventSubscriber\SearchApiSubscriber::getSubscribedEvents()

File

src/EventSubscriber/SearchApiSubscriber.php, line 51

Class

SearchApiSubscriber

Namespace

Drupal\facets\EventSubscriber

Code

public static function getSubscribedEvents() {

  // Workaround to avoid a fatal error during site install from existing config.
  // @see https://www.drupal.org/project/facets/issues/3199156
  if (!class_exists('\\Drupal\\search_api\\Event\\SearchApiEvents', TRUE)) {
    return [];
  }
  return [
    SearchApiEvents::QUERY_PRE_EXECUTE => 'queryAlter',
  ];
}