\Horde_Kolab_Storage_Folder_Namespace

The Horde_Kolab_Storage_Folder_Namespace:: class handles IMAP namespaces and allows to derive folder information from folder names.

Copyright 2004-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()
matchNamespace()
getOwner()
getSubpath()
getParent()
getTitle()
constructFolderName()
setTitle()
setTitleInOther()
setTitleInShared()
getIterator()
__toString()
No public properties found
PERSONAL
OTHER
SHARED
initialize()
$user
N/A
_getNamespace()
$_namespaces
$_prefix_namespaces
$_any
N/A

Constants

PERSONAL

PERSONAL

The possible namespace types (RFC 2342 [5])

OTHER

OTHER

SHARED

SHARED

Properties

$user

$user : string

The current user.

Type

string

$_namespaces

$_namespaces : array

The namespaces.

Type

array

$_prefix_namespaces

$_prefix_namespaces : array

The namespaces with a defined prefix.

Type

array

Methods

__construct()

__construct(array  $namespaces) 

Constructor.

Parameters

array $namespaces

The namespaces.

matchNamespace()

matchNamespace(string  $name) : \Horde_Kolab_Storage_Folder_Namespace_Element

Match a folder name with the corresponding namespace.

Parameters

string $name

The name of the folder.

Throws

\Horde_Kolab_Storage_Exception

If the namespace of the folder cannot be determined.

Returns

\Horde_Kolab_Storage_Folder_Namespace_Element

The corresponding namespace.

getOwner()

getOwner(string  $name) : string

Return the owner of a folder.

Parameters

string $name

The name of the folder.

Returns

string —

The owner of the folder.

getSubpath()

getSubpath(string  $name) : string

Get the sub path for the given folder name.

Parameters

string $name

The folder name.

Returns

string —

The sub path.

getParent()

getParent(string  $name) : string

Get the parent for the given folder name.

Parameters

string $name

The parent folder name.

Returns

string —

The parent.

getTitle()

getTitle(string  $name) : string

Return the title of a folder.

Parameters

string $name

The name of the folder.

Returns

string —

The title of the folder.

constructFolderName()

constructFolderName(string  $owner, string  $subpath, string  $prefix = null) : string

Construct the Kolab storage folder name based on the folder title and the owner.

Parameters

string $owner

The owner of the folder.

string $subpath

The folder subpath.

string $prefix

The namespace prefix.

Returns

string —

The folder name for the backend.

setTitle()

setTitle(string  $title) : string

Generate an IMAP folder name in the personal namespace.

Parameters

string $title

The new folder title.

Returns

string —

The IMAP folder name.

setTitleInOther()

setTitleInOther(string  $title, string  $owner) : string

Generate an IMAP folder name in the other namespace.

Parameters

string $title

The new folder title.

string $owner

The new owner of the folder.

Returns

string —

The IMAP folder name.

setTitleInShared()

setTitleInShared(string  $title) : string

Generate an IMAP folder name in the shared namespace.

Parameters

string $title

The new folder title.

Returns

string —

The IMAP folder name.

getIterator()

getIterator() 

__toString()

__toString() : string

Convert the namespace description to a string.

Returns

string —

The namespace description.

initialize()

initialize(array  $namespaces) : NULL

Initialize the class with a set of namespace configurations.

Parameters

array $namespaces

The namespaces.

Returns

NULL

_getNamespace()

_getNamespace(string  $type, string  $prefix = null) : \Horde_Kolab_Storage_Folder_Namespace_Element

Get the namespace matching the given type and (optional) prefix.

Parameters

string $type

The namespace type.

string $prefix

The namespace prefix

Returns

\Horde_Kolab_Storage_Folder_Namespace_Element

The namespace.