3 namespace Drupal\Core\Entity;
6 * A storage that supports translatable entity types.
8 interface TranslatableStorageInterface {
11 * Constructs a new entity translation object, without permanently saving it.
13 * @param \Drupal\Core\Entity\ContentEntityInterface $entity
14 * The entity object being translated.
15 * @param string $langcode
16 * The translation language code.
17 * @param array $values
18 * (optional) An associative array of initial field values keyed by field
19 * name. If none is provided default values will be applied.
21 * @return \Drupal\Core\Entity\ContentEntityInterface
22 * Another instance of the specified entity object class with the specified
23 * active language and initial values.
25 * @todo Consider accepting \Drupal\Core\Entity\TranslatableInterface as first
26 * parameter. See https://www.drupal.org/project/drupal/issues/2932049.
28 public function createTranslation(ContentEntityInterface $entity, $langcode, array $values = []);