Array support change
Support of mapping xml attributes
This commit is contained in:
@ -18,6 +18,7 @@ class ComplexType extends Configuration
|
||||
private $name;
|
||||
private $value;
|
||||
private $isNillable = false;
|
||||
private $isAttribute = false;
|
||||
|
||||
public function getName()
|
||||
{
|
||||
@ -49,6 +50,26 @@ class ComplexType extends Configuration
|
||||
$this->isNillable = (bool) $isNillable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isAttribute()
|
||||
{
|
||||
return $this->isAttribute;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $isAttribute
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setIsAttribute($isAttribute)
|
||||
{
|
||||
$this->isAttribute = $isAttribute;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAliasName()
|
||||
{
|
||||
return 'complextype';
|
||||
|
@ -20,6 +20,7 @@ class ComplexType
|
||||
private $name;
|
||||
private $value;
|
||||
private $isNillable = false;
|
||||
private $isAttribute = false;
|
||||
|
||||
public function getName()
|
||||
{
|
||||
@ -46,6 +47,26 @@ class ComplexType
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isAttribute()
|
||||
{
|
||||
return $this->isAttribute;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $isAttribute
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setIsAttribute($isAttribute)
|
||||
{
|
||||
$this->isAttribute = $isAttribute;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setNillable($isNillable)
|
||||
{
|
||||
$this->isNillable = (bool) $isNillable;
|
||||
|
@ -155,7 +155,7 @@ class AnnotationClassLoader extends Loader
|
||||
$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->isAttribute());
|
||||
}
|
||||
|
||||
$this->typeRepository->addComplexType($complexType);
|
||||
|
@ -58,6 +58,7 @@ class AnnotationComplexTypeLoader extends AnnotationClassLoader
|
||||
$propertyComplexType = new ComplexType();
|
||||
$propertyComplexType->setValue($complexType->getValue());
|
||||
$propertyComplexType->setNillable($complexType->isNillable());
|
||||
$propertyComplexType->setIsAttribute($complexType->isAttribute());
|
||||
$propertyComplexType->setName($property->getName());
|
||||
$annotations['properties']->add($propertyComplexType);
|
||||
}
|
||||
|
Reference in New Issue
Block a user