class ContentModerationRouteSubscriber extends RouteSubscriberBase (View source)

internal  There is ongoing discussion about how pending revisions should behave. The logic enabling pending revision support is likely to change once a decision is made.
 

Subscriber for moderated revisionable entity forms.

Properties

protected EntityTypeManagerInterface $entityTypeManager

The entity type manager.

protected ContentEntityTypeInterface[] $moderatedEntityTypes

An associative array of moderated entity types keyed by ID.

Methods

alterRoutes(RouteCollection $collection)

Alters existing routes for a specific collection.

static 
getSubscribedEvents()

{@inheritdoc}

onAlterRoutes(RouteBuildEvent $event)

Delegates the route altering to self::alterRoutes().

__construct(EntityTypeManagerInterface $entity_type_manager)

ContentModerationRouteSubscriber constructor.

setLatestRevisionFlag(Route $route)

Ensure revisionable entities load the latest revision on entity forms.

getModeratedEntityTypes()

Returns the moderated entity types.

Details

protected alterRoutes(RouteCollection $collection)

Alters existing routes for a specific collection.

Parameters

RouteCollection $collection

The route collection for adding routes.

static getSubscribedEvents()

{@inheritdoc}

onAlterRoutes(RouteBuildEvent $event)

Delegates the route altering to self::alterRoutes().

Parameters

RouteBuildEvent $event

The route build event.

__construct(EntityTypeManagerInterface $entity_type_manager)

ContentModerationRouteSubscriber constructor.

Parameters

EntityTypeManagerInterface $entity_type_manager

The entity type manager.

protected setLatestRevisionFlag(Route $route)

Ensure revisionable entities load the latest revision on entity forms.

Parameters

Route $route

The route object.

protected ContentEntityTypeInterface[] getModeratedEntityTypes()

Returns the moderated entity types.

Return Value

ContentEntityTypeInterface[]

An associative array of moderated entity types keyed by ID.