entityTypeManager = $entity_type_manager; $this->entityRepository = $entity_repository; } /** * {@inheritdoc} */ public function convert($value, $definition, $name, array $defaults) { list (, $entity_type_id) = explode(':', $definition['type'], 2); $entity = $this->entityTypeManager->getStorage($entity_type_id)->loadRevision($value); return $this->entityRepository->getTranslationFromContext($entity); } /** * {@inheritdoc} */ public function applies($definition, $name, Route $route) { return isset($definition['type']) && strpos($definition['type'], 'entity_revision:') !== FALSE; } }