\Horde_Kolab_Server_Decorator_Count

A server decorator that counts the number of database calls and reports them via a logger.

Copyright 2008-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.

Summary

Methods
Properties
Constants
__construct()
__destruct()
connectGuid()
getGuid()
getBaseGuid()
read()
readAttributes()
find()
findBelow()
save()
add()
delete()
rename()
getSchema()
getParentGuid()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$_server
$_logger
$_count
N/A

Properties

$_server

$_server : \Horde_Kolab_Server

The server we delegate to.

Type

\Horde_Kolab_Server

$_logger

$_logger : \Horde_Log_Logger

The log handler.

Type

\Horde_Log_Logger

$_count

$_count : array

The statistic.

Type

array

Methods

__construct()

__construct(\Horde_Kolab_Server  $server, mixed  $logger) 

Constructor.

Parameters

\Horde_Kolab_Server $server

The base server connection.

mixed $logger

The log handler. The class must at least provide the debug() method.

__destruct()

__destruct() 

Destructor.

Logs the counted events.

connectGuid()

connectGuid(string  $guid = null, string  $pass = null) : \NULL.

Connect to the server.

Parameters

string $guid

The global unique id of the user.

string $pass

The password.

Throws

\Horde_Kolab_Server_Exception

If the connection failed.

Returns

\NULL.

getGuid()

getGuid() : string

Get the current GUID

Returns

string —

The GUID of the connected user.

getBaseGuid()

getBaseGuid() : string

Get the base GUID of this server

Returns

string —

The base GUID of this server.

read()

read(string  $guid, array  $attrs = array()) : array

Low level access to reading object data.

This function provides direct access to the Server data.

Usually you should use

$object = $server->fetch('a server uid'); $variable = $object['attribute']

to access object attributes. This is slower but takes special object handling into account (e.g. custom attribute parsing).

Parameters

string $guid

The object to retrieve.

array $attrs

Restrict to these attributes.

Throws

\Horde_Kolab_Server_Exception

If the search operation hit an error or returned no result.

Returns

array —

An array of attributes.

readAttributes()

readAttributes(string  $guid, string  $attrs) : array

Low level access to reading some object attributes.

Parameters

string $guid

The object to retrieve.

string $attrs

Restrict to these attributes.

Throws

\Horde_Kolab_Server_Exception

Returns

array —

An array of attributes.

find()

find(string  $query, array  $params = array()) : \Horde_Kolab_Server_Result

Finds object data matching a given set of criteria.

Parameters

string $query

The LDAP search query

array $params

Additional search parameters.

Throws

\Horde_Kolab_Server_Exception

Returns

\Horde_Kolab_Server_Result —

The result object.

findBelow()

findBelow(string  $query, string  $parent, array  $params = array()) : \Horde_Kolab_Server_Result

Finds all object data below a parent matching a given set of criteria.

Parameters

string $query

The LDAP search query

string $parent

The parent to search below.

array $params

Additional search parameters.

Throws

\Horde_Kolab_Server_Exception

Returns

\Horde_Kolab_Server_Result —

The result object.

save()

save(\Horde_Kolab_Server_Object  $object, array  $data) : NULL

Modify existing object data.

Parameters

\Horde_Kolab_Server_Object $object

The object to be modified.

array $data

The attributes of the object to be stored.

Throws

\Horde_Kolab_Server_Exception

Returns

NULL

add()

add(\Horde_Kolab_Server_Object  $object, array  $data) : NULL

Add new object data.

Parameters

\Horde_Kolab_Server_Object $object

The object to be added.

array $data

The attributes of the object to be added.

Throws

\Horde_Kolab_Server_Exception

Returns

NULL

delete()

delete(string  $guid) : NULL

Delete an object.

Parameters

string $guid

The GUID of the object to be deleted.

Throws

\Horde_Kolab_Server_Exception

Returns

NULL

rename()

rename(string  $guid, string  $new) : NULL

Rename an object.

Parameters

string $guid

The GUID of the object to be renamed.

string $new

The new GUID of the object.

Throws

\Horde_Kolab_Server_Exception

Returns

NULL

getSchema()

getSchema() : \Horde_Ldap_Schema

Return the ldap schema.

Throws

\Horde_Kolab_Server_Exception

If retrieval of the schema failed.

Returns

\Horde_Ldap_Schema —

The LDAP schema.

getParentGuid()

getParentGuid(string  $guid) : string

Get the parent GUID of this object.

Parameters

string $guid

The GUID of the child.

Returns

string —

the parent GUID of this object.