public function EntityStorageControllerBase::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 EntityStorageControllerInterface::resetCache

3 methods override EntityStorageControllerBase::resetCache()
RoleStorageController::resetCache in drupal/core/modules/user/lib/Drupal/user/RoleStorageController.php
Resets the internal, static entity cache.
TermStorageController::resetCache in drupal/core/modules/taxonomy/lib/Drupal/taxonomy/TermStorageController.php
Overrides Drupal\Core\Entity\DatabaseStorageController::resetCache().
VocabularyStorageController::resetCache in drupal/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyStorageController.php
Overrides Drupal\Core\Config\Entity\ConfigStorageController::resetCache().

File

drupal/core/lib/Drupal/Core/Entity/EntityStorageControllerBase.php, line 99
Contains \Drupal\Core\Entity\EntityStorageControllerBase.

Class

EntityStorageControllerBase
A base entity storage controller class.

Namespace

Drupal\Core\Entity

Code

public function resetCache(array $ids = NULL) {
  if ($this->cache && isset($ids)) {
    foreach ($ids as $id) {
      unset($this->entityCache[$id]);
    }
  }
  else {
    $this->entityCache = array();
  }
}