EntityTestTranslationController.php

Definition of Drupal\translation_entity\EntityTranslationController.

Namespace

Drupal\entity_test

File

drupal/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestTranslationController.php
View source
<?php

/**
 * @file
 * Definition of Drupal\translation_entity\EntityTranslationController.
 */
namespace Drupal\entity_test;

use Drupal\Core\Entity\EntityInterface;
use Drupal\translation_entity\EntityTranslationController;

/**
 * Test entity translation controller.
 */
class EntityTestTranslationController extends EntityTranslationController {

  /**
   * Overrides EntityTranslationControllerInterface::removeTranslation().
   */
  public function removeTranslation(EntityInterface $entity, $langcode) {
    $translation = $entity
      ->getTranslation($langcode);
    foreach ($translation
      ->getPropertyDefinitions() as $property_name => $langcode) {
      $translation->{$property_name} = array();
    }
  }

}

Classes

Namesort descending Description
EntityTestTranslationController Test entity translation controller.