Maileon PHP client  1.5.0
Easily integrate your PHP application with Maileon.
AddEntriesAction.php
1 <?php
2 
10 {
15  public $importName;
16 
21  public $entries;
22 
23  function fromXML($xmlElement)
24  {
25  // not implemented
26  }
27 
28  function toXML()
29  {
30  $xml = new \SimpleXMLElement("<?xml version=\"1.0\"?><add_entries_action></add_entries_action>");
31 
32  // Some fields are mandatory, especially when setting data to the API
33  if (isset($this->importName)) $xml->addChild("import_name", $this->importName);
34 
35  if (is_array($this->entries)) {
36  $entries = $xml->addChild("entries");
37  foreach ($this->entries as $entry) {
38  $entries->addChild("entry", $entry);
39  }
40  }
41  return $xml;
42  }
43 
44  function toString()
45  {
46  return "AddEntriesAction [importName=" . $this->importName . ", entries=[" . (is_array($this->entries) ? implode(", ", $this->entries) : "") . "]]";
47 
48  }
49 }