EntityRevisionConverter
class EntityRevisionConverter extends EntityConverter (View source)
| internal | This class only exists to provide backwards compatibility with the load_pending_revision flag, the predecessor to load_latest_revision. The core entity converter now natively loads the latest revision of an entity when the load_latest_revision flag is present. This flag is also added automatically to all entity forms. |
Defines a class for making sure the edit-route loads the current draft.
Traits
Provides a standard way to announce deprecated properties.
Provides a trait to replace dynamic entity types in routes.
Properties
| protected | $deprecatedProperties | {@inheritdoc} | from EntityConverter |
| protected EntityTypeManagerInterface | $entityTypeManager | Entity type manager which performs the upcasting in the end. |
from EntityConverter |
| protected EntityRepositoryInterface | $entityRepository | Entity repository. |
from EntityConverter |
Methods
Determines the entity type ID given a route definition and route defaults.
Constructs a new EntityConverter.
Converts path variables to their corresponding objects.
Returns the latest revision translation of the specified entity.
Loads the specified entity revision.
Determines if the converter applies to a specific route and variable.
Returns a language manager instance.
Details
__get($name)
Allows to access deprecated/removed properties.
This method must be public.
protected string
getEntityTypeFromDefaults(mixed $definition, string $name, array $defaults)
Determines the entity type ID given a route definition and route defaults.
__construct(EntityTypeManagerInterface $entity_type_manager, EntityRepositoryInterface $entity_repository = NULL)
Constructs a new EntityConverter.
mixed|null
convert(mixed $value, mixed $definition, string $name, array $defaults)
Converts path variables to their corresponding objects.
protected RevisionableInterface
getLatestTranslationAffectedRevision(RevisionableInterface $entity, string $langcode)
deprecated
deprecated
Returns the latest revision translation of the specified entity.
protected RevisionableInterface
loadRevision(RevisionableInterface $entity, string $revision_id)
deprecated
deprecated
Loads the specified entity revision.
bool
applies(mixed $definition, string $name, Route $route)
Determines if the converter applies to a specific route and variable.
protected LanguageManagerInterface
languageManager()
| internal |
Returns a language manager instance.