You are here

public function EdgeConfigTranslationChangeSubscriber::clearCache in Apigee Edge 8

Clears caches when an Edge entity type's config translation gets updated.

Parameters

\Drupal\language\Config\LanguageConfigOverrideCrudEvent $event: The event object.

File

src/EventSubscriber/EdgeConfigTranslationChangeSubscriber.php, line 54

Class

EdgeConfigTranslationChangeSubscriber
Clears caches when an Apigee Edge related config translation gets updated.

Namespace

Drupal\apigee_edge\EventSubscriber

Code

public function clearCache(LanguageConfigOverrideCrudEvent $event) {

  /** @var \Drupal\language\Config\LanguageConfigOverride $override */
  $override = $event
    ->getLanguageConfigOverride();
  if (preg_match('/^apigee_edge/', $override
    ->getName())) {

    // It is easier to do that rather than just trying to figure our all
    // cache bins and tags that requires invalidation. We tried that.
    drupal_flush_all_caches();
  }
}