c9d93fef4ff46594ccdc6c130af8141a90958f64
[yaffs-website] / web / core / lib / Drupal / Core / Entity / TranslatableStorageInterface.php
1 <?php
2
3 namespace Drupal\Core\Entity;
4
5 /**
6  * A storage that supports translatable entity types.
7  */
8 interface TranslatableStorageInterface {
9
10   /**
11    * Constructs a new entity translation object, without permanently saving it.
12    *
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.
20    *
21    * @return \Drupal\Core\Entity\ContentEntityInterface
22    *   Another instance of the specified entity object class with the specified
23    *   active language and initial values.
24    *
25    * @todo Consider accepting \Drupal\Core\Entity\TranslatableInterface as first
26    *   parameter. See https://www.drupal.org/project/drupal/issues/2932049.
27    */
28   public function createTranslation(ContentEntityInterface $entity, $langcode, array $values = []);
29
30 }