W3cubDocs

/Drupal 8

function entity_render_cache_clear

entity_render_cache_clear()

Clears the entity render cache for all entity types.

File

core/includes/entity.inc, line 15
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();
    }
  }
}

© 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!includes!entity.inc/function/entity_render_cache_clear/8.1.x