You are here

function entity_render_cache_clear in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/includes/entity.inc \entity_render_cache_clear()

Clears the entity render cache for all entity types.

File

core/includes/entity.inc, line 13
Entity API for handling entities like nodes or users.

Code

function entity_render_cache_clear() {
  $entity_manager = Drupal::entityManager();
  foreach ($entity_manager
    ->getDefinitions() as $entity_type => $info) {
    if ($entity_manager
      ->hasHandler($entity_type, 'view_builder')) {
      $entity_manager
        ->getViewBuilder($entity_type)
        ->resetCache();
    }
  }
}