aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/XMLRPCBoolParameter.php
blob: c53d9ad146d35725ca702c27dd7add558654a319 (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
<?php
/**
 * A boolean.
 *
 * @package    Elgg.Core
 * @subpackage XMLRPC
 */
class XMLRPCBoolParameter extends XMLRPCParameter {

	/**
	 * New bool parameter
	 *
	 * @param bool $value Value
	 */
	function __construct($value) {
		parent::__construct();

		$this->value = (bool)$value;
	}

	/**
	 * Convert to string
	 *
	 * @return string
	 */
	function __toString() {
		$code = ($this->value) ? "1" : "0";
		return "<value><boolean>{$code}</boolean></value>";
	}
}