50 $this->content = array();
51 $this->attachments = array();
54 $this->
import->permission = com_maileon_api_contacts_Permission::$NONE;
65 $handle = fopen($filename,
"rb");
66 if (FALSE === $filename) {
70 while (!feof($handle)) {
71 $contents .= fread($handle, 8192);
74 if ($attachmentFileName === null) {
75 $attachmentFileName = basename($filename);
78 $this->attachments[] = $attachment;
89 $this->attachments[] = $attachment;
100 $this->attachments[] = $attachment;
108 return "Transaction [type=" . $this->type .
", contact=(" . (empty( $this->contact))?
"":$this->contact->toString() .
"), import=(" . (empty( $this->
import))?
"":$this->import->toString() .
"), content=(" . json_encode($this->content) .
")]";
112 $array = parent::toArray();
114 if(isset($array[
'import'])) {
115 unset($array[
'contact']);
116 $array[
'import'] = array(
"contact" => $array[
'import'] );
addAttachmentFromBase64Data($filename, $mimetype, $contents)
addAttachmentFromFile($filename, $mimetype, $attachmentFileName=null)
addAttachmentFromBinaryData($filename, $mimetype, $contents)