Interface AttachmentsHandlerInterface
Class AttachmentsHandlerInterface
Methods summary
public
EmailAttachment
|
#
uploadAttachment( EmailAttachmentInterface $attachment )
Upload an attachment to "uploads/tmp" directory.
Upload an attachment to "uploads/tmp" directory.
This method takes the uploaded file information and places it in the "uploads/tmp" directory
as a temporary place, until the "uploadEmailCollection" moves it to the final destination.
Parameters
- $attachment
- Contains the file information (path is required).
Returns
EmailAttachment Returns an EmailAttachment instance with the new attachment path.
|
public
|
|
public
|
#
uploadEmailCollection( EmailCollectionInterface $collection )
Process attachments for each email in collection.
Process attachments for each email in collection.
Important! Use this method after you save the emails into the database. The reason is that
this property separates each attachment file by its email ID, a value that is only accessible
after the email is already saved.
Deprecated
Since v2.3.3.0 this method is marked as deprecated and will be removed from the class.
Parameters
- $collection
Passed by reference, contains emails of which the
attachments must be processed.
|
public
|
#
deleteEmailCollection( EmailCollectionInterface $collection )
Delete attachments for each email in collection.
Delete attachments for each email in collection.
Every email has its own attachments directory. When emails are deleted we need
to remove their respective attachments.
Deprecated
Since v2.3.3.0 this method is marked as deprecated and will be removed from the class.
Parameters
- $collection
- Contains email records to be deleted.
|
public
integer
|
#
getAttachmentsSize( )
Get attachments directory file size in bytes.
Get attachments directory file size in bytes.
Returns
integer Returns the size in bytes.
|
public
array
|
#
deleteOldAttachments( DateTime $removalDate )
Delete old attachments prior to removal date.
Delete old attachments prior to removal date.
This method will remove all the files and directories that are prior to the given date.
It will return removal information so that user can see how much disc spaces was set free.
Parameters
- $removalDate
- From this date and before the attachment files will be removed.
Returns
array Returns an array which contains the "count" and "size" values or the operation.
|
public
|
#
backupEmailAttachments( EmailInterface & $email )
Process email attachments.
Process email attachments.
This method will move all the email attachments to the "uploads/attachments" directory
and store them there for future reference and history navigation purposes. The email needs
to be saved first because the email ID will be used to distinguish the emails.
Parameters
- $email
- Passed by reference, contains the email data.
|
public
|
#
deleteEmailAttachments( EmailInterface $email )
Deletes email attachments.
Deletes email attachments.
This method will remove all the email attachments from the server.
Parameters
- $email
- Contains the email information.
|
public
|
#
emptyTempDirectory( )
Removes all files within the "uploads/tmp" directory.
Removes all files within the "uploads/tmp" directory.
There might be cases where old unused files are left within the "tmp" directory and they
need to be deleted. This function will remove all these files.
|