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// |
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. |
protected array |
$pluginData
= array()
Storage for the plugin data. |
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. |
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.
Name | Type | Description |
---|---|---|
$namespace |
string | |
$key |
string |
Type | Description |
---|---|
ezcBaseValueException |
if the $namespace is unknown by the ezcWebdavPluginRegistry or if $key is not a string. |
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.
Name | Type | Description |
---|---|---|
$namespace |
string | |
$key |
string |
Type | Description |
---|---|
ezcBaseValueException |
if the $namespace is unknown by the ezcWebdavPluginRegistry or if $key is not a string. |
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.
Name | Type | Description |
---|---|---|
$namespace |
string | |
$key |
string |
Type | Description |
---|---|
ezcBaseValueException |
if the $namespace is unknown by the ezcWebdavPluginRegistry or if $key is not a string. |
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.
Name | Type | Description |
---|---|---|
$namespace |
string | |
$key |
string | |
$data |
mixed |
Type | Description |
---|---|
ezcBaseValueException |
if the $namespace is unknown by the ezcWebdavPluginRegistry or if $key is not a string. |