You are here

protected function ContentEntityBase::clearTranslationCache in Drupal 9

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 511

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']);
  }
}