diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index ad5d39d..46a1ae0 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -457,25 +457,7 @@ public function getEntityTypeLabels() { } /** - * Returns the entity translation to be used in the given context. - * - * This will check whether a translation for the desired language is available - * and if not, it will fall back to the most appropriate translation based on - * the provided context. - * - * @param \Drupal\Core\Entity\ContentEntityInterface $entity - * The entity whose translation will be returned. - * @param string $langcode - * (optional) The language of the current context. Defaults to the current - * content language. - * @param array $context - * (optional) An associative array of arbitrary data that can be useful to - * determine the proper fallback sequence. - * - * @return \Drupal\Core\Entity\ContentEntityInterface - * A content entity object for the translated data. - * - * @see \Drupal\Core\Language\LanguageManager::getFallbackCandidates() + * {@inheritdoc} */ function getTranslationFromContext(ContentEntityInterface $entity, $langcode = NULL, $context = array()) { $translation = $entity; diff --git a/core/lib/Drupal/Core/Entity/EntityManagerInterface.php b/core/lib/Drupal/Core/Entity/EntityManagerInterface.php index 0e898cb..0cfa9be 100644 --- a/core/lib/Drupal/Core/Entity/EntityManagerInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityManagerInterface.php @@ -244,4 +244,27 @@ public function getForm(EntityInterface $entity, $operation = 'default', array $ */ public function getBundleInfo($entity_type); + /** + * Returns the entity translation to be used in the given context. + * + * This will check whether a translation for the desired language is available + * and if not, it will fall back to the most appropriate translation based on + * the provided context. + * + * @param \Drupal\Core\Entity\ContentEntityInterface $entity + * The entity whose translation will be returned. + * @param string $langcode + * (optional) The language of the current context. Defaults to the current + * content language. + * @param array $context + * (optional) An associative array of arbitrary data that can be useful to + * determine the proper fallback sequence. + * + * @return \Drupal\Core\Entity\ContentEntityInterface + * A content entity object for the translated data. + * + * @see \Drupal\Core\Language\LanguageManager::getFallbackCandidates() + */ + function getTranslationFromContext(ContentEntityInterface $entity, $langcode = NULL, $context = array()); + }