Check that complex type has not in classmap before adding

This commit is contained in:
Francis Besset 2011-11-26 19:59:09 +01:00
parent bacdc90870
commit 16ee889230
1 changed files with 5 additions and 1 deletions

View File

@ -36,6 +36,8 @@ class ComplexType extends AbstractStrategy
*/ */
public function addComplexType($type) public function addComplexType($type)
{ {
$classmap = $this->definition->getClassmap();
if (null !== $soapType = $this->scanRegisteredTypes($type)) { if (null !== $soapType = $this->scanRegisteredTypes($type)) {
return $soapType; return $soapType;
} }
@ -49,7 +51,9 @@ class ComplexType extends AbstractStrategy
$soapTypeName = Wsdl::translateType($type); $soapTypeName = Wsdl::translateType($type);
$soapType = 'tns:'.$soapTypeName; $soapType = 'tns:'.$soapTypeName;
$this->definition->getClassmap()->add($soapTypeName, $type); if (!$classmap->has($soapTypeName)) {
$classmap->add($soapTypeName, $type);
}
// Register type here to avoid recursion // Register type here to avoid recursion
$this->getContext()->addType($type, $soapType); $this->getContext()->addType($type, $soapType);