class AccessUnpublishedServiceProvider in Access unpublished 8
Decorates the access_check.latest_revision service.
Hierarchy
- class \Drupal\Core\DependencyInjection\ServiceProviderBase implements ServiceModifierInterface, ServiceProviderInterface
- class \Drupal\access_unpublished\AccessUnpublishedServiceProvider
Expanded class hierarchy of AccessUnpublishedServiceProvider
File
- src/
AccessUnpublishedServiceProvider.php, line 13
Namespace
Drupal\access_unpublishedView source
class AccessUnpublishedServiceProvider extends ServiceProviderBase {
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) {
if ($container
->hasDefinition('access_check.latest_revision')) {
$container
->register('access_unpublished.access_check.latest_revision', LatestRevisionCheck::class)
->setDecoratedService('access_check.latest_revision')
->addArgument(new Reference('access_unpublished.access_check.latest_revision.inner'))
->addTag('access_check', [
'applies_to' => '_content_moderation_latest_version',
]);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AccessUnpublishedServiceProvider:: |
public | function |
Modifies existing service definitions. Overrides ServiceProviderBase:: |
|
ServiceProviderBase:: |
public | function |
Registers services to the container. Overrides ServiceProviderInterface:: |
1 |