Modules/Groupware/Email/Attachment/Facade.php
\Conjoon_Modules_Groupware_Email_Attachment_Facade
Package: Default
- Author
- Thorsten Suckow-Homberg
Properties

\Conjoon_Modules_Groupware_Email_Attachment_Model_Attachment
$_attachmentModel= 'null'
Default value
nullDetails

\Conjoon_Modules_Groupware_Email_Attachment_Facade
$_instance= 'null'
static
Default value
nullDetails
Methods

_getAttachmentModel(
)
:
\Conjoon_Modules_Groupware_Email_Attachment_Model_Attachment
Returns
| Type | Description |
|---|---|
| \Conjoon_Modules_Groupware_Email_Attachment_Model_Attachment |

_getItemModel(
)
:
\Conjoon_Modules_Groupware_Email_Item_Model_Item
Returns
| Type | Description |
|---|---|
| \Conjoon_Modules_Groupware_Email_Item_Model_Item |

generateAttachmentKey(
$userId
)
:
stringGenerates a unique id for an attachment. This id is a string with a length of 32 chars, alphanumeric.
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $userId |
| Type | Description |
|---|---|
| string |

getAttachmentDownloadDataForUserId(
mixed $attachmentKey, integer $attachmentId, \inter $userId
)
:
arrayReturns download data for the required attachment, i.e. mime type, filename and content. The data will be returned in an associative array and is already prepared for sending to the client, i.e. the content to send has already been decoded if necessary.
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $attachmentKey | mixed | |
| $attachmentId | integer | |
| $userId | \inter |
| Type | Description |
|---|---|
| array | an assoc array with the keys "name", "mimeType" and "content", or null if item is not available. |
| Exception | Description |
|---|---|
| \InvalidArgumentException |

isAttachmentDownloadableForUserId(
string $attachmentKey, integer $attachmentId, integer $userId
)
:
booleanReturns true if the user may download the attachment with the specified id, otherwise false.
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $attachmentKey | string | The key of the attachment to download |
| $attachmentId | integer | The id of the attachment to download |
| $userId | integer | The id of the user who requests the attachment being downloaded |
| Type | Description |
|---|---|
| boolean | true if he may download the attachment, otherwise false |
| Exception | Description |
|---|---|
| \InvalidArgumentException |