public function KeyValueContentEntityStorage::createTranslation in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueContentEntityStorage.php \Drupal\Core\Entity\KeyValueStore\KeyValueContentEntityStorage::createTranslation()
Constructs a new entity translation object, without permanently saving it.
@todo Consider accepting \Drupal\Core\Entity\TranslatableInterface as first parameter. See https://www.drupal.org/project/drupal/issues/2932049.
Parameters
\Drupal\Core\Entity\ContentEntityInterface $entity: The entity object being translated.
string $langcode: The translation language code.
array $values: (optional) An associative array of initial field values keyed by field name. If none is provided default values will be applied.
Return value
\Drupal\Core\Entity\ContentEntityInterface Another instance of the specified entity object class with the specified active language and initial values.
Overrides TranslatableStorageInterface::createTranslation
File
- core/
lib/ Drupal/ Core/ Entity/ KeyValueStore/ KeyValueContentEntityStorage.php, line 18
Class
- KeyValueContentEntityStorage
- Provides a key value backend for content entities.
Namespace
Drupal\Core\Entity\KeyValueStoreCode
public function createTranslation(ContentEntityInterface $entity, $langcode, array $values = []) {
// @todo Complete the content entity storage implementation in
// https://www.drupal.org/node/2618436.
}