Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List of objects #91

Closed
wants to merge 5 commits into from
Closed
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
9 changes: 8 additions & 1 deletion ServiceBinding/RpcLiteralResponseMessageBinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,14 @@ private function processType($phpType, $message)

$message = $array;
} else {
$message = $this->checkComplexType($phpType, $message);
if (is_array($message)) {
foreach ($message as $complexType) {
$array[] = $this->checkComplexType($phpType, $complexType);
}
$message = $array;
} else {
$message = $this->checkComplexType($phpType, $message);
}
}
}

Expand Down
21 changes: 20 additions & 1 deletion ServiceDefinition/Annotation/ComplexType.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class ComplexType extends Configuration
private $name;
private $value;
private $isNillable = false;
private $minOccurs;
private $maxOccurs;

public function getName()
{
Expand Down Expand Up @@ -49,8 +51,25 @@ public function setNillable($isNillable)
$this->isNillable = (bool) $isNillable;
}

public function getMinOccurs()
{
return $this->minOccurs;
}
public function setMinOccurs($minOccurs)
{
$this->minOccurs = $minOccurs;
}
public function getMaxOccurs()
{
return $this->maxOccurs;
}
public function setMaxOccurs($maxOccurs)
{
$this->maxOccurs = $maxOccurs;
}

public function getAliasName()
{
return 'complextype';
}
}
}
22 changes: 22 additions & 0 deletions ServiceDefinition/ComplexType.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class ComplexType
private $name;
private $value;
private $isNillable = false;
private $minOccurs;
private $maxOccurs;

public function getName()
{
Expand Down Expand Up @@ -50,4 +52,24 @@ public function setNillable($isNillable)
{
$this->isNillable = (bool) $isNillable;
}

public function getMinOccurs()
{
return $this->minOccurs;
}

public function setMinOccurs($minOccurs)
{
$this->minOccurs = $minOccurs;
}

public function getMaxOccurs()
{
return $this->maxOccurs;
}

public function setMaxOccurs($maxOccurs)
{
$this->maxOccurs = $maxOccurs;
}
}
2 changes: 1 addition & 1 deletion ServiceDefinition/Loader/AnnotationClassLoader.php
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->getMinOccurs(), $property->getMaxOccurs());
}

$this->typeRepository->addComplexType($complexType);
Expand Down
2 changes: 2 additions & 0 deletions ServiceDefinition/Loader/AnnotationComplexTypeLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public function load($class, $type = null)
$propertyComplexType = new ComplexType();
$propertyComplexType->setValue($complexType->getValue());
$propertyComplexType->setNillable($complexType->isNillable());
$propertyComplexType->setMinOccurs($complexType->getMinOccurs());
$propertyComplexType->setMaxOccurs($complexType->getMaxOccurs());
$propertyComplexType->setName($property->getName());
$annotations['properties']->add($propertyComplexType);
}
Expand Down