]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/nusoap/class.soap_val.php
Release 6.5.0
[Github/sugarcrm.git] / include / nusoap / class.soap_val.php
1 <?php
2
3 /*
4
5 Modification information for LGPL compliance
6
7 r57813 - 2010-08-19 10:34:44 -0700 (Thu, 19 Aug 2010) - kjing - Author: John Mertic <jmertic@sugarcrm.com>
8     Bug 39085 - When loading the opposite search panel via ajax on the ListViews, call the index action instead of the ListView action to avoid touching pre-MVC code by accident.
9
10 r56990 - 2010-06-16 13:05:36 -0700 (Wed, 16 Jun 2010) - kjing - snapshot "Mango" svn branch to a new one for GitHub sync
11
12 r56989 - 2010-06-16 13:01:33 -0700 (Wed, 16 Jun 2010) - kjing - defunt "Mango" svn dev branch before github cutover
13
14 r55980 - 2010-04-19 13:31:28 -0700 (Mon, 19 Apr 2010) - kjing - create Mango (6.1) based on windex
15
16 r51719 - 2009-10-22 10:18:00 -0700 (Thu, 22 Oct 2009) - mitani - Converted to Build 3  tags and updated the build system 
17
18 r51634 - 2009-10-19 13:32:22 -0700 (Mon, 19 Oct 2009) - mitani - Windex is the branch for Sugar Sales 1.0 development
19
20 r50375 - 2009-08-24 18:07:43 -0700 (Mon, 24 Aug 2009) - dwong - branch kobe2 from tokyo r50372
21
22 r42807 - 2008-12-29 11:16:59 -0800 (Mon, 29 Dec 2008) - dwong - Branch from trunk/sugarcrm r42806 to branches/tokyo/sugarcrm
23
24 r13782 - 2006-06-06 10:58:55 -0700 (Tue, 06 Jun 2006) - majed - changes entry point code
25
26 r11115 - 2006-01-17 14:54:45 -0800 (Tue, 17 Jan 2006) - majed - add entry point validation
27
28 r8846 - 2005-10-31 11:01:12 -0800 (Mon, 31 Oct 2005) - majed - new version of nusoap
29
30 r5462 - 2005-05-25 13:50:11 -0700 (Wed, 25 May 2005) - majed - upgraded nusoap to .6.9
31
32 r573 - 2004-09-04 13:03:32 -0700 (Sat, 04 Sep 2004) - sugarclint - undoing copyrights added in inadvertantly.  --clint
33
34 r546 - 2004-09-03 11:49:38 -0700 (Fri, 03 Sep 2004) - sugarmsi - removed echo count
35
36 r354 - 2004-08-02 23:00:37 -0700 (Mon, 02 Aug 2004) - sugarjacob - Adding Soap
37
38
39 */
40
41
42 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
43
44
45
46
47 /**
48 * For creating serializable abstractions of native PHP types.  This class
49 * allows element name/namespace, XSD type, and XML attributes to be
50 * associated with a value.  This is extremely useful when WSDL is not
51 * used, but is also useful when WSDL is used with polymorphic types, including
52 * xsd:anyType and user-defined types.
53 *
54 * @author   Dietrich Ayala <dietrich@ganx4.com>
55
56 * @access   public
57 */
58 class soapval extends nusoap_base {
59         /**
60          * The XML element name
61          *
62          * @var string
63          * @access private
64          */
65         var $name;
66         /**
67          * The XML type name (string or false)
68          *
69          * @var mixed
70          * @access private
71          */
72         var $type;
73         /**
74          * The PHP value
75          *
76          * @var mixed
77          * @access private
78          */
79         var $value;
80         /**
81          * The XML element namespace (string or false)
82          *
83          * @var mixed
84          * @access private
85          */
86         var $element_ns;
87         /**
88          * The XML type namespace (string or false)
89          *
90          * @var mixed
91          * @access private
92          */
93         var $type_ns;
94         /**
95          * The XML element attributes (array or false)
96          *
97          * @var mixed
98          * @access private
99          */
100         var $attributes;
101
102         /**
103         * constructor
104         *
105         * @param    string $name optional name
106         * @param    mixed $type optional type name
107         * @param        mixed $value optional value
108         * @param        mixed $element_ns optional namespace of value
109         * @param        mixed $type_ns optional namespace of type
110         * @param        mixed $attributes associative array of attributes to add to element serialization
111         * @access   public
112         */
113         function soapval($name='soapval',$type=false,$value=-1,$element_ns=false,$type_ns=false,$attributes=false) {
114                 parent::nusoap_base();
115                 $this->name = $name;
116                 $this->type = $type;
117                 $this->value = $value;
118                 $this->element_ns = $element_ns;
119                 $this->type_ns = $type_ns;
120                 $this->attributes = $attributes;
121     }
122
123         /**
124         * return serialized value
125         *
126         * @param        string $use The WSDL use value (encoded|literal)
127         * @return       string XML data
128         * @access   public
129         */
130         function serialize($use='encoded') {
131                 return $this->serialize_val($this->value, $this->name, $this->type, $this->element_ns, $this->type_ns, $this->attributes, $use, true);
132     }
133
134         /**
135         * decodes a soapval object into a PHP native type
136         *
137         * @return       mixed
138         * @access   public
139         */
140         function decode(){
141                 return $this->value;
142         }
143 }
144
145
146
147
148 ?>