## Apache Zeta Components Manual :: Docs For Class ezcWebdavInfrastructureBase

### Webdav::ezcWebdavInfrastructureBase

### Class ezcWebdavInfrastructureBase

Base class for all infrastructural classes of the Webdav component.

The Webdav component provides a nifty plugin system that allows extension developers to hook into the flow of the Webdav component. Since this system makes it hard to extend infrastructural classes, like request or response classes, to add storage for custom plugin data.

To solve this need for plugins to attach data to the instance of an infrastructural class, this abstract base class has been invented which is extended by all infrastructural classes.

You can attach data to objects that inherit this class by using the {@see $this->setPluginData()} method, receive data back using {@see $this->getPluginData()} and detach once attached data using $this->removePluginData(). A check if data is available for a given plugin namespace and key can be checked using $this->hasPluginData().

NOTE: The plugin API is not public, yet, and will be released in a later version of this component.

Source for this file: /Webdav/src/interfaces/infrastructure_base.php

Version: | //autogen//

### Descendants

Child Class | Description
--- | ---
ezcWebdavProperty | Base class for WebDAV property representation classes.
ezcWebdavResponse | Base class for all response objects.
ezcWebdavRequestPropertyBehaviourContent | Class representing the <propertybehaviour /> XML element in the COPY/MOVE request body.

### Member Variables

protected array | `$pluginData = array()` Storage for the plugin data.

### Method Summary

public mixed | `getPluginData( $namespace , $key )` Retrieves plugin data from the storage.
public bool | `hasPluginData( $namespace , $key )` Returns if plugin data is available in the storage.
public void | `removePluginData( $namespace , $key )` Removes plugin data from the storage.
public void | `setPluginData( $namespace , $key , $data )` Sets plugin data in the storage.

### Methods

#### getPluginData

mixed getPluginData( string $namespace , string $key )

Retrieves plugin data from the storage.

This method returns the data that was stored under the given plugin $namespace and data $key. If the given $namespace is unknown by the global ezcWebdavPluginRegistry an ezcBaseValueException will be thrown. If no data exists with the given $key, null will be returned.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$namespace` | string |
`$key` | string |

##### Exceptions:

Type | Description
--- | ---
`ezcBaseValueException` | if the $namespace is unknown by the ezcWebdavPluginRegistry or if $key is not a string.

#### hasPluginData

bool hasPluginData( string $namespace , string $key )

Returns if plugin data is available in the storage.

This method checks if there is data available for the given plugin $namespace and data $key. If the given $namespace is unknown by the global ezcWebdavPluginRegistry an ezcBaseValueException will be thrown. If data (not null) is assigned to the given key this method returns true, otherwise false.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$namespace` | string |
`$key` | string |

##### Exceptions:

Type | Description
--- | ---
`ezcBaseValueException` | if the $namespace is unknown by the ezcWebdavPluginRegistry or if $key is not a string.

#### removePluginData

void removePluginData( string $namespace , string $key )

Removes plugin data from the storage.

Completly removes the data identified by the given plugin $namespace and the data $key. If the $namespace is not a known by the global ezcWebdavPluginRegistry an ezcBaseValueException will be thrown. If the given $key has no data assigned inside the plugins private data store, this call is silently ignored.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$namespace` | string |
`$key` | string |

##### Exceptions:

Type | Description
--- | ---
`ezcBaseValueException` | if the $namespace is unknown by the ezcWebdavPluginRegistry or if $key is not a string.

#### setPluginData

void setPluginData( string $namespace , string $key , mixed $data )

Sets plugin data in the storage.

This method is used to set plugin data in the internal data storage. The $namespace parameter must be the valid namespace of a plugin registered with the ezcWebdavPluginRegistry. If this is not the case, an ezcBaseValueException will be thrown.

The $key parameter is a string used to identify the data added uniquely inside the private storage area of the client. The $key is needed to retrieve the data back using $this->getPluginData().

The $data to store can be of any arbitrary PHP type. If there is already $data stored in the position of the data store it will be overwritten.

##### Parameters:

Name | Type | Description
--- | --- | ---
`$namespace` | string |
`$key` | string |
`$data` | mixed |

##### Exceptions:

Type | Description
--- | ---
`ezcBaseValueException` | if the $namespace is unknown by the ezcWebdavPluginRegistry or if $key is not a string.

Documentation generated by phpDocumentor 1.4.3