mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-19 00:34:24 +00:00
32 lines
915 B
PHP
32 lines
915 B
PHP
<?php
|
|
|
|
/**
|
|
* Chill is a software for social workers
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Chill\MainBundle\Templating\Entity;
|
|
|
|
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|
use Symfony\Component\DependencyInjection\Reference;
|
|
|
|
/**
|
|
* Add service tagged with `chill.render_entity` to appropriate service.
|
|
*/
|
|
class CompilerPass implements CompilerPassInterface
|
|
{
|
|
public function process(ContainerBuilder $container)
|
|
{
|
|
$extension = $container->getDefinition(ChillEntityRenderExtension::class);
|
|
|
|
foreach ($container->findTaggedServiceIds('chill.render_entity') as $id => $tags) {
|
|
$extension->addMethodCall('addRender', [new Reference($id)]);
|
|
}
|
|
}
|
|
}
|