Source of file Transaction.php
Size: 1,407 Bytes - Last Modified: 2021-12-24T06:51:34+00:00
/var/www/docs.ssmods.com/process/src/src/DependencyInjection/CompilerPass/Transaction.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 | <?php /** * This file is part of the Heystack package * * @package Heystack */ /** * CompilerPass namespace */ namespace Heystack\Ecommerce\DependencyInjection\CompilerPass; use Heystack\Ecommerce\Services; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; /** * Merges extensions definition calls into the container builder. * * When there exists an extension which defines calls on an existing service, * this compiler pass will merge those calls without overwriting. * * @copyright Heyday * @author Glenn Bautista * @package Heystack */ class Transaction implements CompilerPassInterface { /** * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container * @return void */ public function process(ContainerBuilder $container) { if (!$container->hasDefinition(Services::TRANSACTION)) { return; } $definition = $container->getDefinition(Services::TRANSACTION); $taggedServices = $container->findTaggedServiceIds(Services::TRANSACTION . '.modifier'); foreach ($taggedServices as $id => $attributes) { $definition->addMethodCall( 'addModifier', [new Reference($id)] ); } } } |