You are here

class soapval in Salesforce Suite 5

Same name in this branch
  1. 5 includes/nusoap.php \soapval
  2. 5 includes/nusoap.orig.php \soapval
Same name and namespace in other branches
  1. 5.2 includes/nusoap.php \soapval
  2. 5.2 includes/nusoap.orig.php \soapval

For creating serializable abstractions of native PHP types. This class allows element name/namespace, XSD type, and XML attributes to be associated with a value. This is extremely useful when WSDL is not used, but is also useful when WSDL is used with polymorphic types, including xsd:anyType and user-defined types.

@author Dietrich Ayala <dietrich@ganx4.com> @access public

Hierarchy

  • class \soapval extends \nusoap_base

Expanded class hierarchy of soapval

4 string references to 'soapval'
nusoap_base::serialize_val in includes/nusoap.php
* serializes PHP values in accordance w/ section 5. Type information is * not serialized if $use == 'literal'. * * @access public
nusoap_base::serialize_val in includes/nusoap.orig.php
* serializes PHP values in accordance w/ section 5. Type information is * not serialized if $use == 'literal'. * * @access public
wsdl::serializeType in includes/nusoap.php
* serializes a PHP value according a given type definition * *
wsdl::serializeType in includes/nusoap.orig.php
* serializes a PHP value according a given type definition * *

File

includes/nusoap.php, line 1905

View source
class soapval extends nusoap_base {

  /**
   * The XML element name
   *
   * @var string
   * @access private
   */
  var $name;

  /**
   * The XML type name (string or false)
   *
   * @var mixed
   * @access private
   */
  var $type;

  /**
   * The PHP value
   *
   * @var mixed
   * @access private
   */
  var $value;

  /**
   * The XML element namespace (string or false)
   *
   * @var mixed
   * @access private
   */
  var $element_ns;

  /**
   * The XML type namespace (string or false)
   *
   * @var mixed
   * @access private
   */
  var $type_ns;

  /**
   * The XML element attributes (array or false)
   *
   * @var mixed
   * @access private
   */
  var $attributes;

  /**
   * constructor
   *
   * @param    string $name optional name
   * @param    mixed $type optional type name
   * @param	mixed $value optional value
   * @param	mixed $element_ns optional namespace of value
   * @param	mixed $type_ns optional namespace of type
   * @param	mixed $attributes associative array of attributes to add to element serialization
   * @access   public
   */
  function soapval($name = 'soapval', $type = false, $value = -1, $element_ns = false, $type_ns = false, $attributes = false) {
    parent::nusoap_base();
    $this->name = $name;
    $this->type = $type;
    $this->value = $value;
    $this->element_ns = $element_ns;
    $this->type_ns = $type_ns;
    $this->attributes = $attributes;
  }

  /**
   * return serialized value
   *
   * @param	string $use The WSDL use value (encoded|literal)
   * @return	string XML data
   * @access   public
   */
  function serialize($use = 'encoded') {
    return $this
      ->serialize_val($this->value, $this->name, $this->type, $this->element_ns, $this->type_ns, $this->attributes, $use);
  }

  /**
   * decodes a soapval object into a PHP native type
   *
   * @return	mixed
   * @access   public
   */
  function decode() {
    return $this->value;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
soapval::$attributes property * The XML element attributes (array or false) * * * @access private
soapval::$element_ns property * The XML element namespace (string or false) * * * @access private
soapval::$name property * The XML element name * * * @access private
soapval::$type property * The XML type name (string or false) * * * @access private
soapval::$type_ns property * The XML type namespace (string or false) * * * @access private
soapval::$value property * The PHP value * * * @access private
soapval::decode function * decodes a soapval object into a PHP native type * *
soapval::serialize function * return serialized value * *
soapval::soapval function * constructor * *