Maileon PHP client  1.5.5
Easily integrate your PHP application with Maileon.
Attachment.php
1 <?php
2 
9 {
10  public $id;
11  public $filename;
12  public $sizekb;
13  public $mime_type;
14  public $diagnosis;
15  public $created;
16  public $updated;
17 
29  function __construct(
30  $id = null,
31  $filename = null,
32  $sizekb = null,
33  $mime_type = null,
34  $diagnosis = null,
35  $created = null,
36  $updated = null)
37  {
38  $this->id = $id;
39  $this->filename = $filename;
40  $this->sizekb = $sizekb;
41  $this->mime_type = $mime_type;
42  $this->diagnosis = $diagnosis;
43  $this->created = $created;
44  $this->updated = $updated;
45  }
46 
53  function fromXML($xmlElement)
54  {
55  if (isset($xmlElement->id)) { $this->id = (int)$xmlElement->id; }
56  if (isset($xmlElement->filename)) { $this->filename = (string)$xmlElement->filename; }
57  if (isset($xmlElement->sizekb)) { $this->sizekb = (int)$xmlElement->sizekb; }
58  if (isset($xmlElement->mime_type)) { $this->mime_type = (string)$xmlElement->mime_type; }
59  if (isset($xmlElement->diagnosis)) { $this->diagnosis = (string)$xmlElement->diagnosis; }
60  if (isset($xmlElement->created)) { $this->created = (string)$xmlElement->created; }
61  if (isset($xmlElement->updated)) { $this->updated = (string)$xmlElement->updated; }
62  }
63 
69  function toXML() {
70  /*$xml = new SimpleXMLElement("<?xml version=\"1.0\"?><attachment></attachment>");
71 
72  $xml->addChild("id", $this->id);
73  $xml->addChild("filename", $this->filename);
74  $xml->addChild("sizekb", $this->sizekb);
75  $xml->addChild("mime_type", $this->mime_type);
76  $xml->addChild("diagnosis", $this->diagnosis);
77  $xml->addChild("created", $this->created);
78  $xml->addChild("updated", $this->updated);
79 
80  return $xml;*/
81  throw new com_maileon_api_MaileonAPIException('not implemented');
82  }
83 
90  function toString()
91  {
92  return "Attachment [id=" . $this->id . ", "
93  . "filename=" . $this->filename . ", "
94  . "sizekb=" . $this->sizekb . ", "
95  . "mime_type=" . $this->mime_type . ", "
96  . "diagnosis=" . $this->diagnosis . ", "
97  . "created=" . $this->created . ", "
98  . "updated=" . $this->updated . "]";
99  }
100 }
__construct($id=null, $filename=null, $sizekb=null, $mime_type=null, $diagnosis=null, $created=null, $updated=null)
Definition: Attachment.php:29