/** * Set the data for the message. * * @param var arr */ public function setData($value) { $encoder = new XmlRpcEncoder(); $params = $this->tree->root()->addChild(new Node('params')); $param = $params->addChild(new Node('param')); $param->addChild($encoder->encode($value)); }
/** * Set the data for the message. * * @param var arr */ public function setData($arr) { $encoder = new XmlRpcEncoder(); $params = $this->tree->root()->addChild(new Node('params')); if (sizeof($arr)) { foreach (array_keys($arr) as $idx) { $n = $params->addChild(new Node('param')); $n->addChild($encoder->encode($arr[$idx])); } } }
/** * Set a fault for this message. This overwrites any previously set * return values. * * @param int faultcode * @param string faultstring */ public function setFault($faultcode, $faultstring) { $encoder = new XmlRpcEncoder(); $this->tree->root()->addChild(new Node('fault'))->addChild($encoder->encode(array('faultCode' => $faultcode, 'faultString' => $faultstring))); }