public function EntityTypeBundleInfo::clearCachedBundles

public EntityTypeBundleInfo::clearCachedBundles()

Clears static and persistent bundles.

Overrides EntityTypeBundleInfoInterface::clearCachedBundles

File

core/lib/Drupal/Core/Entity/EntityTypeBundleInfo.php, line 121

Class

EntityTypeBundleInfo
Provides discovery and retrieval of entity type bundles.

Namespace

Drupal\Core\Entity

Code

public function clearCachedBundles() {
  $this->bundleInfo = [];
  Cache::invalidateTags(['entity_bundles']);
  // Entity bundles are exposed as data types, clear that cache too.
  $this->typedDataManager->clearCachedDefinitions();
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!EntityTypeBundleInfo.php/function/EntityTypeBundleInfo::clearCachedBundles/8.1.x