Nextcloud PHP API (master)

IAttachment

Mail Attachment Interface

This interface is used for defining individual attachments that are attached to a message

Tags
since
30.0.0

Table of Contents

Methods

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

Methods

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 one is 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