class Attachment implements Arrayable, JsonSerializable (View source)

Methods

__construct(string|null $filename, string|null $contentId, string $contentType, string|null $contentDisposition, StreamInterface $contentStream)

Constructor.

string|null
filename()

Get the attachment's filename.

string|null
contentId()

Get the attachment's content ID.

string
contentType()

Get the attachment's content type.

string
contentDisposition()

Get the attachment's content disposition.

string
contents()

Get the attachment's contents.

StreamInterface
contentStream()

Get the attachment's content stream.

false|int
save(string $path)

Save the attachment to a file.

string|null
extension()

Get the attachment's extension.

array
toArray()

Get the array representation of the attachment.

array
jsonSerialize()

Get the JSON representation of the attachment.

Details

__construct(string|null $filename, string|null $contentId, string $contentType, string|null $contentDisposition, StreamInterface $contentStream)

Constructor.

Parameters

string|null $filename
string|null $contentId
string $contentType
string|null $contentDisposition
StreamInterface $contentStream

string|null filename()

Get the attachment's filename.

Return Value

string|null

string|null contentId()

Get the attachment's content ID.

Return Value

string|null

string contentType()

Get the attachment's content type.

Return Value

string

string contentDisposition()

Get the attachment's content disposition.

Return Value

string

string contents()

Get the attachment's contents.

Return Value

string

StreamInterface contentStream()

Get the attachment's content stream.

Return Value

StreamInterface

false|int save(string $path)

Save the attachment to a file.

Parameters

string $path

Return Value

false|int

string|null extension()

Get the attachment's extension.

Return Value

string|null

array toArray()

Get the array representation of the attachment.

Return Value

array

array jsonSerialize()

Get the JSON representation of the attachment.

Return Value

array