EntityStorageBase::resetCache

public EntityStorageBase::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 EntityStorageInterface::resetCache

File

core/lib/Drupal/Core/Entity/EntityStorageBase.php, line 115

Class

EntityStorageBase
A base entity storage class.

Namespace

Drupal\Core\Entity

Code

public function resetCache(array $ids = NULL) {
  if ($this->entityType->isStaticallyCacheable() && isset($ids)) {
    foreach ($ids as $id) {
      unset($this->entities[$id]);
    }
  }
  else {
    $this->entities = array();
  }
}
doc_Drupal
2016-10-29 09:07:42
Comments
Leave a Comment

Please login to continue.