You are here

public static function SearchApiSubscriber::getSubscribedEvents in Search API Solr 4.x

File

src/EventSubscriber/SearchApiSubscriber.php, line 41

Class

SearchApiSubscriber
Search API events subscriber.

Namespace

Drupal\search_api_solr\EventSubscriber

Code

public static function getSubscribedEvents() {

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