Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class ComplexType extends Configuration
private $name;
private $value;
private $isNillable = false;
private $tagType = 'element';

public function getName()
{
Expand All @@ -34,6 +35,11 @@ public function isNillable()
return $this->isNillable;
}

public function getTagType()
{
return $this->tagType;
}

public function setName($name)
{
$this->name = $name;
Expand All @@ -49,6 +55,11 @@ public function setNillable($isNillable)
$this->isNillable = (bool) $isNillable;
}

public function setTagType($tagType)
{
$this->tagType = $tagType;
}

public function getAliasName()
{
return 'complextype';
Expand Down
11 changes: 11 additions & 0 deletions src/BeSimple/SoapBundle/ServiceDefinition/ComplexType.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class ComplexType
private $name;
private $value;
private $isNillable = false;
private $tagType = 'element';

public function getName()
{
Expand All @@ -36,6 +37,11 @@ public function isNillable()
return $this->isNillable;
}

public function getTagType()
{
return $this->tagType;
}

public function setName($name)
{
$this->name = $name;
Expand All @@ -50,4 +56,9 @@ public function setNillable($isNillable)
{
$this->isNillable = (bool) $isNillable;
}

public function setTagType($tagType)
{
$this->tagType = $tagType;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private function loadType($phpType)
$loaded = $complexTypeResolver->load($phpType);
$complexType = new ComplexType($phpType, isset($loaded['alias']) ? $loaded['alias'] : $phpType);
foreach ($loaded['properties'] as $name => $property) {
$complexType->add($name, $this->loadType($property->getValue()), $property->isNillable());
$complexType->add($name, $this->loadType($property->getValue()), $property->isNillable(), $property->getTagType());
}

$this->typeRepository->addComplexType($complexType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public function load($class, $type = null)
$propertyComplexType->setValue($complexType->getValue());
$propertyComplexType->setNillable($complexType->isNillable());
$propertyComplexType->setName($property->getName());
$propertyComplexType->setTagType($complexType->getTagType());
$annotations['properties']->add($propertyComplexType);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/BeSimple/SoapCommon/Definition/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ public function isEmpty()
return 0 === count($this->parts) ? true : false;
}

public function add($name, $phpType, $nillable = false)
public function add($name, $phpType, $nillable = false, $tagType = 'element')
{
if ($phpType instanceof TypeInterface) {
$phpType = $phpType->getPhpType();
}

$this->parts[$name] = new Part($name, $phpType, $nillable);
$this->parts[$name] = new Part($name, $phpType, $nillable, $tagType);

return $this;
}
Expand Down
9 changes: 8 additions & 1 deletion src/BeSimple/SoapCommon/Definition/Part.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ class Part
protected $name;
protected $type;
protected $nillable;
protected $tagType;

public function __construct($name, $type, $nillable = false)
public function __construct($name, $type, $nillable = false, $tagType)
{
$this->name = $name;
$this->type = $type;
$this->setNillable($nillable);
$this->tagType = $tagType;
}

public function getName()
Expand All @@ -52,4 +54,9 @@ public function setNillable($nillable)
{
$this->nillable = (boolean) $nillable;
}

public function getTagType()
{
return $this->tagType;
}
}