EmailAttachment
in package
implements
EmailAttachmentInterface
Class EmailAttachment
Email attachment will serve as the path to the file that needs to be attached (located on the server).
Tags
Interfaces, Classes and Traits
- EmailAttachmentInterface
- Interface EmailAttachmentInterface
Table of Contents
- $configuration : AttachmentConfigurationInterface|null
- E-Mail attachment configuration.
- $name : string
- E-Mail attachment name.
- $path : string
- E-Mail attachment path.
- __construct() : mixed
- Constructor
- getConfiguration() : AttachmentConfigurationInterface|null
- Returns the configuration of an email attachment.
- getName() : AttachmentNameInterface
- Returns the name of an email attachment.
- getPath() : AttachmentPathInterface
- Returns the path of an email attachment.
- setConfiguration() : mixed
- Sets the configuration of an email attachment.
- setName() : mixed
- Sets the name of an email attachment.
- setPath() : mixed
- Sets the path of an email attachment.
- _convertToRelativePath() : string
- Convert a path to relative.
Properties
$configuration
E-Mail attachment configuration.
protected
AttachmentConfigurationInterface|null
$configuration
$name
E-Mail attachment name.
protected
string
$name
$path
E-Mail attachment path.
protected
string
$path
Methods
__construct()
Constructor
public
__construct([AttachmentPathInterface $path = null ][, AttachmentNameInterface $name = null ][, AttachmentConfigurationInterface $configuration = null ]) : mixed
Entity representing an email attachment.
Parameters
- $path : AttachmentPathInterface = null
-
(optional) Attachment path.
- $name : AttachmentNameInterface = null
-
(optional) Attachment name.
- $configuration : AttachmentConfigurationInterface = null
-
(optional) Attachment configuration.
Return values
mixed —getConfiguration()
Returns the configuration of an email attachment.
public
getConfiguration() : AttachmentConfigurationInterface|null
Return values
AttachmentConfigurationInterface|null —Attachment configuration or null.
getName()
Returns the name of an email attachment.
public
getName() : AttachmentNameInterface
Return values
AttachmentNameInterface —Attachment name.
getPath()
Returns the path of an email attachment.
public
getPath([bool $absolutePath = true ]) : AttachmentPathInterface
Parameters
- $absolutePath : bool = true
-
(optional) Whether to return the absolute path or the relative one.
Return values
AttachmentPathInterface —Attachment path.
setConfiguration()
Sets the configuration of an email attachment.
public
setConfiguration(AttachmentConfigurationInterface $configuration) : mixed
Parameters
- $configuration : AttachmentConfigurationInterface
-
Attachment configuration.
Return values
mixed —setName()
Sets the name of an email attachment.
public
setName(AttachmentNameInterface $name) : mixed
Parameters
- $name : AttachmentNameInterface
-
Attachment name.
Return values
mixed —setPath()
Sets the path of an email attachment.
public
setPath(AttachmentPathInterface $path) : mixed
Parameters
- $path : AttachmentPathInterface
-
Attachment path.
Return values
mixed —_convertToRelativePath()
Convert a path to relative.
protected
_convertToRelativePath([AttachmentPathInterface $path = null ]) : string
Due to different server setups this process can be tedious and hard to foresee. The following method contains the conversion logic and must be used in any setter of the class.
Parameters
- $path : AttachmentPathInterface = null
-
Attachment path.
Return values
string —Returns the converted path.