19 $this->properties = array();
34 if ($value ===
true) $this->properties[$key] = 1;
35 else if ($value ===
false) $this->properties[$key] = 0;
36 else $this->properties[$key] = $value;
54 $xml =
new SimpleXMLElement(
"<?xml version=\"1.0\"?><event></event>");
57 if (isset($this->email)) $xml->addChild(
"email", $this->email);
58 if (isset($this->external_id)) $xml->addChild(
"external_id", $this->external_id);
60 if (count($this->properties) > 0) {
61 foreach ($this->properties as $index => $value) {
65 $property = $xml->addChild(
"property", $value);
67 $property = $xml->addChild(
"property");
68 $property->addAttribute(
"nil",
true);
71 $property->addAttribute(
"key", $index);
84 $xml = $this->
toXML();
97 if (count($this->properties) > 0) {
98 foreach ($this->properties as $index => $value) {
99 $properties .= $index .
"=" . $value .
",";
101 $properties = rtrim($properties,
',');
104 return "ContactEvent [email=" . $this->email .
", external_id=" . $this->external_id .
", properties={" . $properties .
"}]";