Пример #1
0
 /**
  * Add an unbounded ArrayOfType based on the xsd:sequence syntax if type[] is detected in return value doc comment.
  *
  * @param string $type
  * @return string tns:xsd-type
  */
 public function addComplexType($type)
 {
     $nestedCounter = $this->_getNestedCount($type);
     if ($nestedCounter > 0) {
         $singularType = $this->_getSingularType($type);
         for ($i = 1; $i <= $nestedCounter; $i++) {
             $complexType = $this->_getTypeBasedOnNestingLevel($singularType, $i);
             $complexTypePhp = $singularType . str_repeat('[]', $i);
             $childType = $this->_getTypeBasedOnNestingLevel($singularType, $i - 1);
             $this->_addSequenceType($complexType, $childType, $complexTypePhp);
         }
         return $complexType;
     } elseif (($soapType = $this->scanRegisteredTypes($type)) !== null) {
         // Existing complex type
         return $soapType;
     } else {
         // New singular complex type
         return parent::addComplexType($type);
     }
 }
Пример #2
0
 /**
  * Add an unbounded ArrayOfType based on the xsd:sequence syntax if type[] is detected in return value doc comment.
  *
  * @param string $type
  * @return string tns:xsd-type
  */
 public function addComplexType($type)
 {
     $nestedCounter = $this->_getNestedCount($type);
     if ($nestedCounter > 0) {
         $singularType = $this->_getSingularType($type);
         for ($i = 1; $i <= $nestedCounter; $i++) {
             $complexTypeName = substr($this->_getTypeNameBasedOnNestingLevel($singularType, $i), 4);
             $childTypeName = $this->_getTypeNameBasedOnNestingLevel($singularType, $i - 1);
             $this->_addElementFromWSDLAndChildTypes($complexTypeName, $childTypeName);
         }
         // adding the PHP type which is resolved to a nested XSD type. therefore add only once.
         $this->getContext()->addType($complexTypeName);
         return "tns:{$complexTypeName}";
     } else {
         if (!in_array($type, $this->getContext()->getTypes())) {
             // New singular complex type
             return parent::addComplexType($type);
         } else {
             // Existing complex type
             return $this->getContext()->getType($type);
         }
     }
 }