aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/XMLRPCBoolParameter.php
blob: 607841cb8b2da164e11820a9f5f07cfdae8be871 (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>";
	}
}