\Horde_Kolab_Server_Decorator_Map

A server delegation that maps object attributes.

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()
connect()
connectGuid()
getGuid()
getBaseGuid()
read()
readAttributes()
find()
findBelow()
save()
add()
delete()
rename()
getSchema()
mapField()
getParentGuid()
No public properties found
No constants found
unmapAttributes()
mapAttributes()
mapKeys()
No protected properties found
N/A
No private methods found
$_server
$_mapping
N/A

Properties

$_server

$_server : \Horde_Kolab_Server

The server we delegate to.

Type

\Horde_Kolab_Server

$_mapping

$_mapping : array

The attribute mapping.

Type

array

Methods

__construct()

__construct(\Horde_Kolab_Server  $server, array  $mapping) 

Constructor.

Parameters

\Horde_Kolab_Server $server

The base server connection.

array $mapping

The attribute mapping.

connect()

connect(string  $user = null, string  $pass = null) : \NULL.

Connect to the server. Use this method if the user name you can provide does not match a GUID. In this case it will be required to map this user name first.

Parameters

string $user

The user name.

string $pass

The password.

Throws

\Horde_Kolab_Server_Exception

If the connection failed.

Returns

\NULL.

connectGuid()

connectGuid(string  $guid = '', string  $pass = '') : \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()) : array

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

array —

The result array.

findBelow()

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

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

array —

The result array.

save()

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

Modify existing object data.

Parameters

\Horde_Kolab_Server_Object_Interface $object

The object to be modified.

array $data

The attributes of the object to be added.

Throws

\Horde_Kolab_Server_Exception

Returns

NULL

add()

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

Add new object data.

Parameters

\Horde_Kolab_Server_Object_Interface $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.

mapField()

mapField(array  $field) : \The

Map a single attribute key defined within this library into its real world counterpart.

Parameters

array $field

The attribute name.

Returns

\The —

real name of this attribute on the server we connect to.

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.

unmapAttributes()

unmapAttributes(  $data) : NULL

Map attributes defined within this library to their real world counterparts.

Parameters

$data

Returns

NULL

mapAttributes()

mapAttributes(  $data) : NULL

Map attributes defined within this library into their real world counterparts.

Parameters

$data

Returns

NULL

mapKeys()

mapKeys(  $keys) : NULL

Map attribute keys defined within this library into their real world counterparts.

Parameters

$keys

Returns

NULL