Moved Classmap instance in ServiceDefinition

This commit is contained in:
Francis Besset
2011-11-26 12:18:29 +01:00
parent ea65831c12
commit bacdc90870
6 changed files with 29 additions and 22 deletions

View File

@ -11,8 +11,6 @@
namespace BeSimple\SoapBundle\ServiceDefinition\Strategy;
use BeSimple\SoapBundle\ServiceDefinition\Loader\AnnotationComplexTypeLoader;
use BeSimple\SoapCommon\Classmap;
use Zend\Soap\Wsdl;
use Zend\Soap\Wsdl\Strategy\AbstractStrategy;
@ -22,13 +20,11 @@ use Zend\Soap\Wsdl\Strategy\AbstractStrategy;
class ComplexType extends AbstractStrategy
{
private $loader;
private $classmap;
private $definition;
public function __construct(AnnotationComplexTypeLoader $loader, Classmap $classmap, $definition)
public function __construct(AnnotationComplexTypeLoader $loader, $definition)
{
$this->loader = $loader;
$this->classmap = $classmap;
$this->definition = $definition;
}
@ -53,7 +49,7 @@ class ComplexType extends AbstractStrategy
$soapTypeName = Wsdl::translateType($type);
$soapType = 'tns:'.$soapTypeName;
$this->classmap->add($soapTypeName, $type);
$this->definition->getClassmap()->add($soapTypeName, $type);
// Register type here to avoid recursion
$this->getContext()->addType($type, $soapType);