1 | <?php |
||
18 | class Parameter implements Interfaces\Parameter |
||
19 | { |
||
20 | /** |
||
21 | * The parameter type |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $sType; |
||
26 | |||
27 | /** |
||
28 | * The parameter value |
||
29 | * |
||
30 | * @var mixed |
||
31 | */ |
||
32 | protected $xValue; |
||
33 | |||
34 | /** |
||
35 | * The constructor. |
||
36 | * |
||
37 | * @param string $sType The parameter type |
||
38 | * @param mixed $xValue The parameter value |
||
39 | */ |
||
40 | public function __construct($sType, $xValue) |
||
45 | |||
46 | /** |
||
47 | * Get the parameter type |
||
48 | * |
||
49 | * @return string |
||
50 | */ |
||
51 | public function getType() |
||
55 | |||
56 | /** |
||
57 | * Get the parameter value |
||
58 | * |
||
59 | * @return mixed |
||
60 | */ |
||
61 | public function getValue() |
||
65 | |||
66 | /** |
||
67 | * Set the parameter value |
||
68 | * |
||
69 | * @param mixed $xValue The parameter value |
||
70 | * |
||
71 | * @return void |
||
72 | */ |
||
73 | public function setValue($xValue) |
||
77 | |||
78 | /** |
||
79 | * Create a Parameter instance using the given value |
||
80 | * |
||
81 | * @param mixed $xValue The parameter value |
||
82 | * |
||
83 | * @return Parameter |
||
84 | */ |
||
85 | public static function make($xValue) |
||
108 | |||
109 | /** |
||
110 | * Add quotes to a given value |
||
111 | * |
||
112 | * @param string $xValue The value to be quoted |
||
113 | * |
||
114 | * @return string |
||
115 | */ |
||
116 | private function getQuotedValue($xValue) |
||
121 | |||
122 | /** |
||
123 | * Get a js call to Jaxon with a single parameter |
||
124 | * |
||
125 | * @param string $sFunction The function name |
||
126 | * @param string $sParameter The function parameter |
||
127 | * |
||
128 | * @return string |
||
129 | */ |
||
130 | private function getJsCall($sFunction, $sParameter) |
||
134 | |||
135 | /** |
||
136 | * Generate the javascript code. |
||
137 | * |
||
138 | * @return string |
||
139 | */ |
||
140 | public function getScript() |
||
184 | |||
185 | /** |
||
186 | * Magic function to generate the jQuery call. |
||
187 | * |
||
188 | * @return string |
||
189 | */ |
||
190 | public function __toString() |
||
194 | |||
195 | /** |
||
196 | * Generate the jQuery call, when converting the response into json. |
||
197 | * |
||
198 | * This is a method of the JsonSerializable interface. |
||
199 | * |
||
200 | * @return string |
||
201 | */ |
||
202 | public function jsonSerialize() |
||
206 | } |
||
207 |