2011-07-17 10:46:54 +02:00
|
|
|
<?php
|
|
|
|
/*
|
2011-07-18 22:43:12 +02:00
|
|
|
* This file is part of the BeSimpleSoapBundle.
|
2011-07-17 10:46:54 +02:00
|
|
|
*
|
|
|
|
* (c) Christian Kerl <christian-kerl@web.de>
|
|
|
|
*
|
|
|
|
* This source file is subject to the MIT license that is bundled
|
|
|
|
* with this source code in the file LICENSE.
|
|
|
|
*/
|
|
|
|
|
2011-07-18 22:43:12 +02:00
|
|
|
namespace BeSimple\SoapBundle\DependencyInjection\Compiler;
|
2011-07-17 10:46:54 +02:00
|
|
|
|
|
|
|
use Symfony\Component\DependencyInjection\Reference;
|
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|
|
|
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
|
|
|
|
|
|
|
/**
|
2011-07-18 22:59:20 +02:00
|
|
|
* Adds tagged besimple.soap.definition.loader services to ebservice.definition.resolver service
|
2011-07-17 10:46:54 +02:00
|
|
|
*
|
|
|
|
* @author Francis Besset <francis.besset@gmail.com>
|
|
|
|
*/
|
|
|
|
class WebServiceResolverPass implements CompilerPassInterface
|
|
|
|
{
|
|
|
|
public function process(ContainerBuilder $container)
|
|
|
|
{
|
2011-07-18 22:59:20 +02:00
|
|
|
if (false === $container->hasDefinition('besimple.soap.definition.loader.resolver')) {
|
2011-07-17 10:46:54 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-07-18 22:59:20 +02:00
|
|
|
$definition = $container->getDefinition('besimple.soap.definition.loader.resolver');
|
2011-07-17 10:46:54 +02:00
|
|
|
|
2011-07-18 22:59:20 +02:00
|
|
|
foreach ($container->findTaggedServiceIds('besimple.soap.definition.loader') as $id => $attributes) {
|
2011-07-17 10:46:54 +02:00
|
|
|
$definition->addMethodCall('addLoader', array(new Reference($id)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|