You are here

protected function ContentEntityBase::clearTranslationCache in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::clearTranslationCache()

Clear entity translation object cache to remove stale references.

2 calls to ContentEntityBase::clearTranslationCache()
ContentEntityBase::__clone in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Magic method: Implements a deep clone.
ContentEntityBase::__sleep in core/lib/Drupal/Core/Entity/ContentEntityBase.php

File

core/lib/Drupal/Core/Entity/ContentEntityBase.php, line 398
Contains \Drupal\Core\Entity\ContentEntityBase.

Class

ContentEntityBase
Implements Entity Field API specific enhancements to the Entity class.

Namespace

Drupal\Core\Entity

Code

protected function clearTranslationCache() {
  foreach ($this->translations as &$translation) {
    unset($translation['entity']);
  }
}