protected ContentEntityStorageBase::populateAffectedRevisionTranslations(ContentEntityInterface $entity)
Populates the affected flag for all the revision translations.
\Drupal\Core\Entity\ContentEntityInterface $entity: An entity object being saved.
protected function populateAffectedRevisionTranslations(ContentEntityInterface $entity) { if ($this->entityType->isTranslatable() && $this->entityType->isRevisionable()) { $languages = $entity->getTranslationLanguages(); foreach ($languages as $langcode => $language) { $translation = $entity->getTranslation($langcode); // Avoid populating the value if it was already manually set. $affected = $translation->isRevisionTranslationAffected(); if (!isset($affected) && $translation->hasTranslationChanges()) { $translation->setRevisionTranslationAffected(TRUE); } } } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!ContentEntityStorageBase.php/function/ContentEntityStorageBase::populateAffectedRevisionTranslations/8.1.x