aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/XMLRPCBoolParameter.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/classes/XMLRPCBoolParameter.php')
-rw-r--r--engine/classes/XMLRPCBoolParameter.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/engine/classes/XMLRPCBoolParameter.php b/engine/classes/XMLRPCBoolParameter.php
new file mode 100644
index 000000000..607841cb8
--- /dev/null
+++ b/engine/classes/XMLRPCBoolParameter.php
@@ -0,0 +1,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>";
+ }
+}