Closed tomasz-kusy closed 3 years ago
Hi. When we have something like that:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.com/" elementFormDefault="qualified"> <xs:complexType name="MyType"> <xs:attribute name="id" use="required" type="xs:string"/> </xs:complexType> <xs:complexType name="Complex.Type"> <xs:choice> <xs:element name="option1" type="MyType" minOccurs="0" maxOccurs="1"/> <xs:element name="option2" type="xs:string" minOccurs="0" maxOccurs="1"/> </xs:choice> </xs:complexType> </xs:schema>
Generated method setOption1() of Php class ComplexType should allow to pass null parameter, not only MyType. It's necessary when working with serializer. Ex.
setOption1()
ComplexType
null
MyType
public function setOption1(?MyType $option1)
I have ready fix and I can create PR if you wish.
https://github.com/goetas-webservices/xsd2php/pull/139
solved by https://github.com/goetas-webservices/xsd2php/pull/139
Hi. When we have something like that:
Generated method
setOption1()
of Php classComplexType
should allow to passnull
parameter, not onlyMyType
. It's necessary when working with serializer. Ex.I have ready fix and I can create PR if you wish.