You are here

public function EntityTranslationDefaultHandler::removeRevisionTranslations in Entity Translation 7

Overrides EntityTranslationHandlerInterface::removeRevisionTranslations

See also

EntityTranslationHandlerInterface::removeRevisionTranslations()

File

includes/translation.handler.inc, line 800
Default translation handler for the translation module.

Class

EntityTranslationDefaultHandler
Class implementing the default entity translation behaviours.

Code

public function removeRevisionTranslations() {
  $translations_key = $this
    ->getTranslationsKey();
  $keys = array_keys($this->entity->{$translations_key}->data);
  $values = array_fill(0, count($keys), array(
    'hook' => 'delete_revision',
  ));
  $this
    ->removeTranslation(NULL);
  $this->entity->{$translations_key}->hook = array_combine($keys, $values);
}