IMP_Compose_Attachment_Storage
in package
AbstractYes
Abstract base class for attachment data storage.
Tags
Table of Contents
Properties
- $link_url : Horde_Url
- $linked : bool
- $_id : string
- Attachment identifier.
- $_tmpfile : string
- Temporary file location.
- $_user : string
- Attachment owner.
Methods
- __construct() : mixed
- Constructor.
- __get() : mixed
- delete() : mixed
- Delete data from storage.
- exists() : bool
- Does the attachment exist in the storage backend?
- gc() : mixed
- Garbage collection.
- getMetadata() : IMP_Compose_Linked_Metadata
- Return metadata about attachment.
- getTempFile() : string
- Writes attachment data to a temporary file.
- read() : Horde_Stream
- Read attachment data from storage.
- saveMetadata() : mixed
- Save attachment metadata.
- write() : mixed
- Write attachment to storage.
- _read() : mixed
- _write() : mixed
Properties
$link_url read-only
public
Horde_Url
$link_url
The URL, if the attachment is linked.
$linked read-only
public
bool
$linked
Can this attachment be linked?
$_id
Attachment identifier.
protected
string
$_id
$_tmpfile
Temporary file location.
protected
string
$_tmpfile
$_user
Attachment owner.
protected
string
$_user
Methods
__construct()
Constructor.
public
__construct(string $user[, string $id = null ]) : mixed
Parameters
- $user : string
-
Attachment owner.
- $id : string = null
-
Attachment identifier.
__get()
public
__get(mixed $name) : mixed
Parameters
- $name : mixed
delete()
Delete data from storage.
public
abstract delete() : mixed
exists()
Does the attachment exist in the storage backend?
public
abstract exists() : bool
Return values
bool —True if the file exists.
gc()
Garbage collection.
public
gc() : mixed
getMetadata()
Return metadata about attachment.
public
getMetadata() : IMP_Compose_Linked_Metadata
Return values
IMP_Compose_Linked_Metadata —Metadata object.
getTempFile()
Writes attachment data to a temporary file.
public
getTempFile() : string
Tags
Return values
string —Temporary file path.
read()
Read attachment data from storage.
public
read() : Horde_Stream
Tags
Return values
Horde_Stream —Stream object containing data.
saveMetadata()
Save attachment metadata.
public
saveMetadata([IMP_Compose_Linked_Metadata $md = null ]) : mixed
Parameters
- $md : IMP_Compose_Linked_Metadata = null
-
Metadata object. Null will clear all metadata.
write()
Write attachment to storage.
public
write(string $filename, Horde_Mime_Part $part) : mixed
Parameters
- $filename : string
-
Filename containing attachment data.
- $part : Horde_Mime_Part
-
Mime part object containing attachment metadata.
Tags
_read()
protected
abstract _read() : mixed
Tags
_write()
protected
abstract _write(mixed $filename, Horde_Mime_Part $part) : mixed
Parameters
- $filename : mixed
- $part : Horde_Mime_Part