public function ContentEntityStorageInterface::createTranslation
public ContentEntityStorageInterface::createTranslation(ContentEntityInterface $entity, $langcode, array $values = [])
Constructs a new entity translation object, without permanently saving it.
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 A new entity translation object.
File
- core/lib/Drupal/Core/Entity/ContentEntityStorageInterface.php, line 24
Class
- ContentEntityStorageInterface
- A storage that supports content entity types.
Namespace
Drupal\Core\EntityCode
public function createTranslation(ContentEntityInterface $entity, $langcode, array $values = []);
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!ContentEntityStorageInterface.php/function/ContentEntityStorageInterface::createTranslation/8.1.x