Documentation

Horde_Kolab_Storage_Data_Base
in package
implements Horde_Kolab_Storage_Data, Horde_Kolab_Storage_Data_Query

The basic handler for data objects in a Kolab storage folder.

Tags
todo

Clean up _attachments mess.

category

Kolab

author

Gunnar Wrobel wrobel@pardus.de

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

Interfaces, Classes, Traits and Enums

Horde_Kolab_Storage_Data
Defines the Kolab data handler.
Horde_Kolab_Storage_Data_Query
Represents a data query.

Table of Contents

$_driver  : Horde_Kolab_Storage_Driver
The driver for accessing the Kolab storage system.
$_factory  : Horde_Kolab_Storage_Factory
The factory for generating additional resources.
$_folder  : Horde_Kolab_Storage_Folder
The link to the parent folder object.
$_logger  : Horde_Log_Logger
Logger instance, or stub.
$_queries  : array<string|int, mixed>
The list of registered queries.
$_type  : string
The folder type.
$_version  : int
The version of the data.
__construct()  : mixed
Constructor.
create()  : string
Create a new object.
delete()  : null
Delete the specified objects from this data set.
deleteAll()  : null
Delete all objects from this data set.
deleteBackendIds()  : null
Delete the specified messages from this folder.
fetch()  : array<string|int, mixed>
Retrieves the objects for the given UIDs.
fetchComplete()  : array<string|int, mixed>
Retrieves the complete message for the given UID.
fetchPart()  : resource
Retrieves the body part for the given UID and mime part ID.
generateUid()  : string
Generate a unique object ID.
getAttachment()  : resource
Returns the specified attachment.
getAuth()  : string
Return the ID of the current user.
getBackendId()  : string
Return the backend ID for the given object ID.
getDuplicates()  : array<string|int, mixed>
Retrieve the list of object duplicates.
getErrors()  : array<string|int, mixed>
Retrieve the list of object errors.
getId()  : string
Return the ID of this data handler.
getIdParameters()  : array<string|int, mixed>
Return the ID parameters for this data handler.
getObject()  : array<string|int, mixed>
Return the specified object.
getObjectByBackendId()  : array<string|int, mixed>
Retrieve an object in the current folder by backend id.
getObjectIds()  : array<string|int, mixed>
Retrieve all object ids in the current folder.
getObjects()  : array<string|int, mixed>
Retrieve all objects in the current folder.
getObjectsByBackendId()  : array<string|int, mixed>
Retrieve all objects in the current folder by backend id.
getObjectToBackend()  : array<string|int, mixed>
Return the mapping of object IDs to backend IDs.
getPath()  : string
Return the folder path for this data handler.
getQuery()  : Horde_Kolab_Storage_Query
Return a registered query.
getStamp()  : Horde_Kolab_Storage_Folder_Stamp
Report the status of this folder.
getType()  : string
Return the data type represented by this object.
getVersion()  : string
Return the data version.
modify()  : string
Modify an existing object.
move()  : null
Move the specified message from the current folder into a new folder.
objectIdExists()  : bool
Check if the given object ID exists.
registerQuery()  : mixed
Register a query to be updated if the underlying data changes.
setLogger()  : mixed
Set a logger.
synchronize()  : mixed
Synchronize the data information with the information from the backend.

Properties

$_logger

Logger instance, or stub.

protected Horde_Log_Logger $_logger

| Horde_Support_Stub

$_queries

The list of registered queries.

protected array<string|int, mixed> $_queries = array()

$_type

The folder type.

protected string $_type

$_version

The version of the data.

protected int $_version

Methods

__construct()

Constructor.

public __construct(Horde_Kolab_Storage_Folder $folder, Horde_Kolab_Storage_Driver $driver, Horde_Kolab_Storage_Factory $factory[, string $type = null ][, int $version = 1 ]) : mixed
Parameters
$folder : Horde_Kolab_Storage_Folder

The folder to retrieve the data from.

$driver : Horde_Kolab_Storage_Driver

The primary connection driver.

$factory : Horde_Kolab_Storage_Factory

The factory.

$type : string = null

The type of data we want to access in the folder.

$version : int = 1

Format version of the object data.

Return values
mixed —

create()

Create a new object.

public create(array<string|int, mixed> &$object[, bool $raw = false ]) : string
Parameters
$object : array<string|int, mixed>

The array that holds the object data.

$raw : bool = false

True if the data to be stored has been provided in raw format.

Tags
throws
Horde_Kolab_Storage_Exception

In case an error occured while saving the data.

Return values
string —

The ID of the new object or true in case the backend does not support this return value.

delete()

Delete the specified objects from this data set.

public delete(array<string|int, mixed>|string $object_ids) : null
Parameters
$object_ids : array<string|int, mixed>|string

Id(s) of the object to be deleted.

Return values
null —

deleteAll()

Delete all objects from this data set.

public deleteAll() : null
Return values
null —

deleteBackendIds()

Delete the specified messages from this folder.

public deleteBackendIds(array<string|int, mixed>|string $uids) : null
Parameters
$uids : array<string|int, mixed>|string

Backend id(s) of the message to be deleted.

Return values
null —

fetch()

Retrieves the objects for the given UIDs.

public fetch(array<string|int, mixed> $uids[, bool $raw = false ]) : array<string|int, mixed>
Parameters
$uids : array<string|int, mixed>

The message UIDs.

$raw : bool = false

True if the raw format should be returned rather than the parsed data.

Tags
throws
new

Horde_Kolab_Storage_Exception

Return values
array<string|int, mixed> —

An array of objects.

fetchComplete()

Retrieves the complete message for the given UID.

public fetchComplete(string $uid) : array<string|int, mixed>
Parameters
$uid : string

The message UID.

Return values
array<string|int, mixed> —

The message encapsuled as an array that contains a Horde_Mime_Headers and a Horde_Mime_Part object.

fetchPart()

Retrieves the body part for the given UID and mime part ID.

public fetchPart(string $uid, string $id) : resource
Parameters
$uid : string

The message UID.

$id : string

The mime part ID.

Return values
resource —

The message part as stream resource.

generateUid()

Generate a unique object ID.

public generateUid() : string
Return values
string —

The unique ID.

getAttachment()

Returns the specified attachment.

public getAttachment(string $object_id, string $attachment_id) : resource
Parameters
$object_id : string

The object id. @since Kolab_Storage 2.1.0

$attachment_id : string

The attachment id.

Return values
resource —

An open stream to the attachment data.

getAuth()

Return the ID of the current user.

public getAuth() : string
Return values
string —

The current user.

getBackendId()

Return the backend ID for the given object ID.

public getBackendId(mixed $object_id) : string
Parameters
$object_id : mixed
Tags
throws
new

Horde_Kolab_Storage_Exception

Return values
string —

The backend ID for the object.

getDuplicates()

Retrieve the list of object duplicates.

public getDuplicates() : array<string|int, mixed>
Return values
array<string|int, mixed> —

The list of duplicates.

getErrors()

Retrieve the list of object errors.

public getErrors() : array<string|int, mixed>
Return values
array<string|int, mixed> —

The list of errors.

getId()

Return the ID of this data handler.

public getId() : string
Return values
string —

The ID.

getIdParameters()

Return the ID parameters for this data handler.

public getIdParameters() : array<string|int, mixed>
Return values
array<string|int, mixed> —

The ID parameters.

getObject()

Return the specified object.

public getObject(string $object_id) : array<string|int, mixed>
Parameters
$object_id : string

The object id.

Tags
throws
new

Horde_Kolab_Storage_Exception

Return values
array<string|int, mixed> —

The object data as an array.

getObjectByBackendId()

Retrieve an object in the current folder by backend id.

public getObjectByBackendId(string $uid) : array<string|int, mixed>
Parameters
$uid : string

Backend id of the object to be returned.

Return values
array<string|int, mixed> —

An array of all objects.

getObjectIds()

Retrieve all object ids in the current folder.

public getObjectIds() : array<string|int, mixed>
Return values
array<string|int, mixed> —

The object ids.

getObjects()

Retrieve all objects in the current folder.

public getObjects() : array<string|int, mixed>
Return values
array<string|int, mixed> —

An array of all objects.

getObjectsByBackendId()

Retrieve all objects in the current folder by backend id.

public getObjectsByBackendId() : array<string|int, mixed>
Return values
array<string|int, mixed> —

An array of all objects.

getObjectToBackend()

Return the mapping of object IDs to backend IDs.

public getObjectToBackend() : array<string|int, mixed>
Return values
array<string|int, mixed> —

The object to backend mapping.

getPath()

Return the folder path for this data handler.

public getPath() : string
Return values
string —

The folder path.

getType()

Return the data type represented by this object.

public getType() : string
Return values
string —

The type of data this instance handles.

getVersion()

Return the data version.

public getVersion() : string
Return values
string —

The data version.

modify()

Modify an existing object.

public modify(array<string|int, mixed> $object[, bool $raw = false ]) : string
Parameters
$object : array<string|int, mixed>

The array that holds the updated object data.

$raw : bool = false

True if the data to be stored has been provided in raw format.

Tags
throws
Horde_Kolab_Storage_Exception

In case an error occured while saving the data.

Return values
string —

The new backend ID of the modified object or true in case the backend does not support this return value.

move()

Move the specified message from the current folder into a new folder.

public move(string $object_id, string $new_folder) : null
Parameters
$object_id : string

ID of the message to be moved.

$new_folder : string

Target folder.

Return values
null —

objectIdExists()

Check if the given object ID exists.

public objectIdExists(string $object_id) : bool
Parameters
$object_id : string

The object ID.

Return values
bool —

True if the ID was found, false otherwise.

registerQuery()

Register a query to be updated if the underlying data changes.

public registerQuery(string $name, Horde_Kolab_Storage_Query $query) : mixed
Parameters
$name : string

The query name.

$query : Horde_Kolab_Storage_Query

The query to register.

Tags
throws
new

Horde_Kolab_Storage_Exception

Return values
mixed —

setLogger()

Set a logger.

public setLogger(Horde_Log_Logger $logger) : mixed
Parameters
$logger : Horde_Log_Logger

The logger instance.

Return values
mixed —

synchronize()

Synchronize the data information with the information from the backend.

public synchronize([array<string|int, mixed> $params = array() ]) : mixed
Parameters
$params : array<string|int, mixed> = array()

Additional parameters.

Return values
mixed —

Search results