aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/XMLRPCResponse.php
blob: a6256d385852db2f8ee04d9cee00f0ada99643bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php

/**
 * XML-RPC Response.
 *
 * @package    Elgg.Core
 * @subpackage XMLRPC
 */
abstract class XMLRPCResponse {
	/** An array of parameters */
	protected $parameters = array();

	/**
	 * Add a parameter here.
	 *
	 * @param XMLRPCParameter $param The parameter.
	 *
	 * @return void
	 */
	public function addParameter(XMLRPCParameter $param) {
		if (!is_array($this->parameters)) {
			$this->parameters = array();
		}

		$this->parameters[] = $param;
	}

	/**
	 * Add an integer
	 *
	 * @param int $value Value
	 *
	 * @return void
	 */
	public function addInt($value) {
		$this->addParameter(new XMLRPCIntParameter($value));
	}

	/**
	 * Add a string
	 *
	 * @param string $value Value
	 *
	 * @return void
	 */
	public function addString($value) {
		$this->addParameter(new XMLRPCStringParameter($value));
	}

	/**
	 * Add a double
	 *
	 * @param int $value Value
	 *
	 * @return void
	 */
	public function addDouble($value) {
		$this->addParameter(new XMLRPCDoubleParameter($value));
	}

	/**
	 * Add a boolean
	 *
	 * @param bool $value Value
	 *
	 * @return void
	 */
	public function addBoolean($value) {
		$this->addParameter(new XMLRPCBoolParameter($value));
	}
}