Nextcloud PHP API (master)

Attachment
in package
implements IAttachment

Mail Attachment Object

This object is used to define the parameters of a mail attachment

Tags
since
30.0.0

Table of Contents

Interfaces

IAttachment
Mail Attachment Interface

Properties

$contents  : string|null
$embedded  : bool
$name  : string|null
$type  : string|null

Methods

__construct()  : mixed
initialize the mail attachment object
getContents()  : string|null
gets the attachment contents (actual data)
getEmbedded()  : bool
gets the embedded status of the attachment
getName()  : string|null
gets the attachment file name
getType()  : string|null
gets the attachment mime type
setContents()  : self
sets the attachment contents (actual data)
setEmbedded()  : self
sets the embedded status of the attachment
setName()  : self
sets the attachment file name
setType()  : self
sets the attachment mime type

Properties

Methods

__construct()

initialize the mail attachment object

public __construct(string|null $contents, string|null $name, string|null $type[, bool $embedded = false ]) : mixed
Parameters
$contents : string|null

binary contents of file

$name : string|null

file name (e.g example.txt)

$type : string|null

mime type (e.g. text/plain)

$embedded : bool = false

embedded status of the attachment, default is false

Tags
since
30.0.0

getContents()

gets the attachment contents (actual data)

public getContents() : string|null
Tags
since
30.0.0
Return values
string|null

returns the attachment contents or null if not set

getEmbedded()

gets the embedded status of the attachment

public getEmbedded() : bool
Tags
since
30.0.0
Return values
bool

embedded status of the attachment

getName()

gets the attachment file name

public getName() : string|null
Tags
since
30.0.0
Return values
string|null

returns the attachment file name or null if not set

getType()

gets the attachment mime type

public getType() : string|null
Tags
since
30.0.0
Return values
string|null

returns the attachment mime type or null if not set

setContents()

sets the attachment contents (actual data)

public setContents(string $value) : self
Parameters
$value : string

binary contents of file

Tags
since
30.0.0
Return values
self

return this object for command chaining

setEmbedded()

sets the embedded status of the attachment

public setEmbedded(bool $value) : self
Parameters
$value : bool

true - embedded / false - not embedded

Tags
since
30.0.0
Return values
self

return this object for command chaining

setName()

sets the attachment file name

public setName(string $value) : self
Parameters
$value : string

file name (e.g example.txt)

Tags
since
30.0.0
Return values
self

return this object for command chaining

setType()

sets the attachment mime type

public setType(string $value) : self
Parameters
$value : string

mime type (e.g. text/plain)

Tags
since
30.0.0
Return values
self

return this object for command chaining


        
On this page

Search results