->
setRequirement('_content_moderation_latest_version', 'TRUE'
) ->
setOption('_content_moderation_entity_type',
$entity_type_id) ->
setOption('parameters',
[ $entity_type_id =>
[ 'type' => 'entity:' .
$entity_type_id,
'load_latest_revision' => TRUE,
],
]);
// Entity types with serial IDs can specify this in their route
// requirements, improving the matching process.
if ($this->
getEntityTypeIdKeyType($entity_type) === 'integer'
) { $route->
setRequirement($entity_type_id, '\d+'
);
} return $route;
} } /**
* Gets the type of the ID key for a given entity type.
*
* @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
* An entity type.
*
* @return string|null
* The type of the ID key for a given entity type, or NULL if the entity
* type does not support fields.
*/