private function _generateElements(Type $parameter, TypesElement $element) { list($type, $value) = $this->_prepareTypeAndValue($parameter); $element->setElementAttributes($type, $value, $parameter->getName()); if (!TypeHelper::isSimple($parameter)) { $complexType = $this->_generateComplexType($parameter); $element->setComplex($complexType); } }
private function _generateObject(TypesElement $parameter, $schemaElement) { $name = $parameter->getName(); if (self::isAlreadyGenerated($name)) { return; } $element = $this->createElementWithAttributes('xsd:element', array('name' => $name, 'nillable' => 'true', 'type' => 'ns:' . $name)); $complexTypeElement = $this->createElementWithAttributes('xsd:complexType', array('name' => $name)); $sequenceElement = $this->_createElement('xsd:sequence'); $types = $parameter->getElementAttributes(); foreach ($types as $complexType) { $elementPartElement = $this->createElementWithAttributes('xsd:element', array('name' => $complexType['name'], $complexType['type'] => $complexType['value'])); $sequenceElement->appendChild($elementPartElement); } $complex = $parameter->getComplex(); if ($complex) { foreach ($complex as $complexElement) { $this->_generateComplexType($complexElement, $schemaElement); } } $complexTypeElement->appendChild($sequenceElement); $schemaElement->appendChild($complexTypeElement); $schemaElement->appendChild($element); }
protected function _setComplexTypeIfNeeded($complexType, TypesElement $typesElement) { if (TypeHelper::isArray($complexType)) { $typesElement->setComplex($this->_generateArray($complexType)); } elseif ($complexType instanceof Type && !TypeHelper::isSimple($complexType) && $complexType->getComplexType()) { $typesElement->setComplex($this->_generateComplexType($complexType->getComplexType())); } }