Horde_Kolab_Storage_Object_MimeType
in package
Mime type handling for Kolab objects.
Copyright 2011-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Tags
Table of Contents
- $_folder_types : mixed
- $_object_types : mixed
- getMimeTypeFromObjectType() : string
- Determine the mime type given the object type.
- getMimeTypesFromFolderType() : array<string|int, mixed>
- Determine the mime type given the type of the folder that holds the object.
- getObjectTypeFromMimePart() : string|bool
- Determine the object type based on a specific MIME part that carries a Kolab object.
- getObjectTypeFromMimeType() : string|bool
- Determine the object type based on the mime type of a Kolab object.
- matchMimePartToFolderType() : array<string|int, mixed>|bool
- Tries to determine the MIME part that carries an object matching the specified folder type.
- matchMimePartToHeaderType() : string|bool
- Try to determine the MIME part that carries an object matching based on the message headers.
- matchMimePartToObjectType() : string|bool
- Try to determine the MIME part that carries the object of the specified type.
Properties
$_folder_types
private
static mixed
$_folder_types
= array('contact' => array('application/x-vnd.kolab.contact', 'application/x-vnd.kolab.contact.distlist'), 'event' => array('application/x-vnd.kolab.event'), 'journal' => array('application/x-vnd.kolab.journal'), 'note' => array('application/x-vnd.kolab.note'), 'task' => array('application/x-vnd.kolab.task'), 'h-prefs' => array('application/x-vnd.kolab.h-prefs'), 'h-ledger' => array('application/x-vnd.kolab.h-ledger'))
$_object_types
private
static mixed
$_object_types
= array('contact' => 'application/x-vnd.kolab.contact', 'distribution-list' => 'application/x-vnd.kolab.contact.distlist', 'event' => 'application/x-vnd.kolab.event', 'journal' => 'application/x-vnd.kolab.journal', 'note' => 'application/x-vnd.kolab.note', 'task' => 'application/x-vnd.kolab.task', 'configuration' => 'application/x-vnd.kolab.configuration', 'h-prefs' => 'application/x-vnd.kolab.h-prefs', 'h-ledger' => 'application/x-vnd.kolab.h-ledger')
Methods
getMimeTypeFromObjectType()
Determine the mime type given the object type.
public
static getMimeTypeFromObjectType(string $type) : string
Parameters
- $type : string
-
The object type.
Return values
string —The mime type associated to the object type.
getMimeTypesFromFolderType()
Determine the mime type given the type of the folder that holds the object.
public
static getMimeTypesFromFolderType(string $type) : array<string|int, mixed>
Parameters
- $type : string
-
The folder type.
Return values
array<string|int, mixed> —The mime types associated to the folder type.
getObjectTypeFromMimePart()
Determine the object type based on a specific MIME part that carries a Kolab object.
public
static getObjectTypeFromMimePart(Horde_Mime_Part $structure, string $id) : string|bool
Parameters
- $structure : Horde_Mime_Part
-
A structural representation of the mime message.
- $id : string
-
The MIME part carrying the Kolab object.
Return values
string|bool —The object type or false if no matching object type was found.
getObjectTypeFromMimeType()
Determine the object type based on the mime type of a Kolab object.
public
static getObjectTypeFromMimeType(string $mime_type) : string|bool
Parameters
- $mime_type : string
-
The MIME type of the Kolab object.
Return values
string|bool —The object type or false if no matching object type was found.
matchMimePartToFolderType()
Tries to determine the MIME part that carries an object matching the specified folder type.
public
static matchMimePartToFolderType(Horde_Mime_Part $structure, string $type) : array<string|int, mixed>|bool
Parameters
- $structure : Horde_Mime_Part
-
A structural representation of the mime message.
- $type : string
-
The folder type.
Return values
array<string|int, mixed>|bool —The MIME ID and MIME type of the message part carrying an object matching the specified folder type or false if such a part was not identified within the message.
matchMimePartToHeaderType()
Try to determine the MIME part that carries an object matching based on the message headers.
public
static matchMimePartToHeaderType(Horde_Mime_Part $structure, Horde_Mime_Headers $headers) : string|bool
Parameters
- $structure : Horde_Mime_Part
-
A structural representation of the mime message.
- $headers : Horde_Mime_Headers
-
The message headers.
Return values
string|bool —The MIME ID of the message part carrying an object matching the message headers or false if such a part was not identified within the message.
matchMimePartToObjectType()
Try to determine the MIME part that carries the object of the specified type.
public
static matchMimePartToObjectType(Horde_Mime_Part $structure, string $type) : string|bool
Parameters
- $structure : Horde_Mime_Part
-
A structural representation of the mime message.
- $type : string
-
The object type.
Return values
string|bool —The MIME ID of the message part carrying the object of the specified type or false if such a part was not identified within the message.