1: <?php
2: /**
3: * A boolean.
4: *
5: * @package Elgg.Core
6: * @subpackage XMLRPC
7: */
8: class XMLRPCBoolParameter extends XMLRPCParameter {
9:
10: /**
11: * New bool parameter
12: *
13: * @param bool $value Value
14: */
15: function __construct($value) {
16: parent::__construct();
17:
18: $this->value = (bool)$value;
19: }
20:
21: /**
22: * Convert to string
23: *
24: * @return string
25: */
26: function __toString() {
27: $code = ($this->value) ? "1" : "0";
28: return "<value><boolean>{$code}</boolean></value>";
29: }
30: }
31: