Maileon PHP client  1.5.0
Easily integrate your PHP application with Maileon.
AccountPlaceholder.php
1 <?php
2 
9 {
10  public $key;
11  public $value;
12 
19  function __construct(
20  $key = null,
21  $value = null)
22  {
23  $this->key = $key;
24  $this->value = $value;
25  }
26 
33  function fromXML($xmlElement)
34  {
35  if (isset($xmlElement->key)) { $this->key = (string)$xmlElement->key; }
36  if (isset($xmlElement->value)) { $this->value = (string)$xmlElement->value; }
37  }
38 
44  function toXML() {
45  $xml = new SimpleXMLElement("<?xml version=\"1.0\"?><account_placeholder></account_placeholder>");
46 
47  //$xml->addChild("value", $this->value);
48 
49  $xml->addChild("key", $this->key);
50 
51  // Add value as CDATA as it can contain special characters
52  $xml->value = null;
53  $node = dom_import_simplexml($xml->value);
54  $no = $node->ownerDocument;
55  $node->appendChild($no->createCDATASection($this->value));
56 
57  return $xml;
58  }
59 
66  function toString()
67  {
68  return "AccountPlaceholder [key=" . $this->key . ", "
69  . "value=" . $this->value . "]";
70  }
71 }