public ContentEntityStorageBase::resetCache(array $ids = NULL)
Resets the internal, static entity cache.
Parameters
$ids: (optional) If specified, the cache is reset for the entities with the given ids only.
Overrides EntityStorageBase::resetCache
File
- core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php, line 630
Class
- ContentEntityStorageBase
- Base class for content entity storage handlers.
Namespace
Drupal\Core\Entity
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | public function resetCache( array $ids = NULL) { if ( $ids ) { $cids = array (); foreach ( $ids as $id ) { unset( $this ->entities[ $id ]); $cids [] = $this ->buildCacheId( $id ); } if ( $this ->entityType->isPersistentlyCacheable()) { $this ->cacheBackend->deleteMultiple( $cids ); } } else { $this ->entities = array (); if ( $this ->entityType->isPersistentlyCacheable()) { Cache::invalidateTags( array ( $this ->entityTypeId . '_values' )); } } } |
Please login to continue.