-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathModeraServerCrudBundle.php
More file actions
38 lines (33 loc) · 2.06 KB
/
ModeraServerCrudBundle.php
File metadata and controls
38 lines (33 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace Modera\ServerCrudBundle;
use Modera\ExpanderBundle\Ext\ExtensionPoint;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class ModeraServerCrudBundle extends Bundle
{
public function build(ContainerBuilder $container): void
{
// also see \Modera\ServerCrudBundle\ExceptionHandling\ExceptionHandlerInterface
$exceptionHandlersProvider = new ExtensionPoint('modera_server_crud.exception_handling.handlers');
$exceptionHandlersProvider->setDescription('Allows to add additional exception handlers that will be used by AbstractCrudController.');
$exceptionHandlersProviderDescription = <<<TEXT
You will need to use this extension point if you need to apply some custom handling to server-side exceptions. For more
details please see \Modera\ServerCrudBundle\ExceptionHandling\ExceptionHandlerInterface.
TEXT;
$exceptionHandlersProvider->setDetailedDescription($exceptionHandlersProviderDescription);
$container->addCompilerPass($exceptionHandlersProvider->createCompilerPass());
// see \Modera\ServerCrudBundle\Controller\AbstractCrudController::interceptAction
// CAP stands for "Controller Action Interceptor"
$caiProviders = new ExtensionPoint('modera_server_crud.intercepting.cai');
$caiProviders->setDescription('Allows to contribute Controller Action Interceptors used by AbstractCrudController.');
$caiProvidersDescription = <<<TEXT
Allow to add Controller Action Interceptors, for more details please see
\Modera\ServerCrudBundle\Intercepting\ControllerActionsInterceptorInterface.
TEXT;
$caiProviders->setDetailedDescription($caiProvidersDescription);
$container->addCompilerPass($caiProviders->createCompilerPass());
$valueConverterProviders = new ExtensionPoint('modera_server_crud.complex_field_value_converters');
$valueConverterProviders->setDescription('Allows to contribute custom value converters');
$container->addCompilerPass($valueConverterProviders->createCompilerPass());
}
}