public function ContentEntityStorageBase::resetCache in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php \Drupal\Core\Entity\ContentEntityStorageBase::resetCache()
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
4 calls to ContentEntityStorageBase::resetCache()
- TermStorage::resetCache in core/
modules/ taxonomy/ src/ TermStorage.php - Resets the internal, static entity cache.
- UserStorage::deleteRoleReferences in core/
modules/ user/ src/ UserStorage.php - Delete role references.
- UserStorage::updateLastAccessTimestamp in core/
modules/ user/ src/ UserStorage.php - Update the last access timestamp of the user.
- UserStorage::updateLastLoginTimestamp in core/
modules/ user/ src/ UserStorage.php - Update the last login timestamp of the user.
1 method overrides ContentEntityStorageBase::resetCache()
- TermStorage::resetCache in core/
modules/ taxonomy/ src/ TermStorage.php - Resets the internal, static entity cache.
File
- core/
lib/ Drupal/ Core/ Entity/ ContentEntityStorageBase.php, line 613 - Contains \Drupal\Core\Entity\ContentEntityStorageBase.
Class
- ContentEntityStorageBase
- Base class for content entity storage handlers.
Namespace
Drupal\Core\EntityCode
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',
));
}
}
}