You are here

function XMLSchema::addComplexType in Salesforce Suite 5

Same name in this branch
  1. 5 includes/nusoap.php \XMLSchema::addComplexType()
  2. 5 includes/nusoap.orig.php \XMLSchema::addComplexType()
Same name and namespace in other branches
  1. 5.2 includes/nusoap.php \XMLSchema::addComplexType()
  2. 5.2 includes/nusoap.orig.php \XMLSchema::addComplexType()

* adds a complex type to the schema * * example: array * * addType( * 'ArrayOfstring', * 'complexType', * 'array', * '', * 'SOAP-ENC:Array', * array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'string[]'), * 'xsd:string' * ); * * example: PHP associative array ( SOAP Struct ) * * addType( * 'SOAPStruct', * 'complexType', * 'struct', * 'all', * array('myVar'=> array('name'=>'myVar','type'=>'string') * ); * *

Parameters

name: * @param typeClass (complexType|simpleType|attribute) * @param phpType: currently supported are array and struct (php assoc array) * @param compositor (all|sequence|choice) * @param restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array) * @param elements = array ( name = array(name=>'',type=>'') ) * @param attrs = array( * array( * 'ref' => "http://schemas.xmlsoap.org/soap/encoding/:arrayType", * "http://schemas.xmlsoap.org/wsdl/:arrayType" => "string[]" * ) * ) * @param arrayType: namespace:name (http://www.w3.org/2001/XMLSchema:string) * @access public * @see getTypeDef

File

includes/nusoap.php, line 1829

Class

XMLSchema
parses an XML Schema, allows access to it's data, other utility methods no validation... yet. very experimental and limited. As is discussed on XML-DEV, I'm one of the people that just doesn't have time to read the spec(s) thoroughly,…

Code

function addComplexType($name, $typeClass = 'complexType', $phpType = 'array', $compositor = '', $restrictionBase = '', $elements = [], $attrs = [], $arrayType = '') {
  $this->complexTypes[$name] = array(
    'name' => $name,
    'typeClass' => $typeClass,
    'phpType' => $phpType,
    'compositor' => $compositor,
    'restrictionBase' => $restrictionBase,
    'elements' => $elements,
    'attrs' => $attrs,
    'arrayType' => $arrayType,
  );
  $this
    ->xdebug("addComplexType {$name}:");
  $this
    ->appendDebug($this
    ->varDump($this->complexTypes[$name]));
}