class RegisterDynamicController implements CompilerPassInterface
{ public function process(ContainerBuilder
$container): void
{ /** @var array<string, array> $types */
$types =
$container->
getParameter('shopware.bundle.content_type.types'
);
foreach ($types as $name =>
$type) { $backendController =
new Definition(ContentType::
class);
$backendController->
setArguments([ new Reference(\Shopware\Bundle\ContentTypeBundle\Services\ExtjsBuilderInterface::
class),
new Expression('service("Shopware\\\\Bundle\\\\ContentTypeBundle\\\\Services\\\\TypeProvider").getType("' .
$name . '")'
),
new Reference('shopware.bundle.content_type.' .
$name),
]);
$backendController->
addTag( 'shopware.controller',
[ 'controller' => 'Custom' .
ucfirst($name),
'module' => 'backend',
] );
$backendController->
setPublic(true
);