Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ContentEntityBase.php

function ContentEntityBase::clearTranslationCache

Clears 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 540

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal