1: <?php
2:
3: /**
4: * XML-RPC Response.
5: *
6: * @package Elgg.Core
7: * @subpackage XMLRPC
8: */
9: abstract class XMLRPCResponse {
10: /** An array of parameters */
11: protected $parameters = array();
12:
13: /**
14: * Add a parameter here.
15: *
16: * @param XMLRPCParameter $param The parameter.
17: *
18: * @return void
19: */
20: public function addParameter(XMLRPCParameter $param) {
21: if (!is_array($this->parameters)) {
22: $this->parameters = array();
23: }
24:
25: $this->parameters[] = $param;
26: }
27:
28: /**
29: * Add an integer
30: *
31: * @param int $value Value
32: *
33: * @return void
34: */
35: public function addInt($value) {
36: $this->addParameter(new XMLRPCIntParameter($value));
37: }
38:
39: /**
40: * Add a string
41: *
42: * @param string $value Value
43: *
44: * @return void
45: */
46: public function addString($value) {
47: $this->addParameter(new XMLRPCStringParameter($value));
48: }
49:
50: /**
51: * Add a double
52: *
53: * @param int $value Value
54: *
55: * @return void
56: */
57: public function addDouble($value) {
58: $this->addParameter(new XMLRPCDoubleParameter($value));
59: }
60:
61: /**
62: * Add a boolean
63: *
64: * @param bool $value Value
65: *
66: * @return void
67: */
68: public function addBoolean($value) {
69: $this->addParameter(new XMLRPCBoolParameter($value));
70: }
71: }
72: