Apache Zeta Components - high quality PHP components

Apache Zeta Components Manual :: Docs For Class ezcWebdavBasicPropertyStorage

Webdav::ezcWebdavBasicPropertyStorage

Class ezcWebdavBasicPropertyStorage

Container class for ezcWebdavProperty objects.

An instance of this class is used to manage WebDAV properties, namely instances of ezcWebdavProperty. Properties are structured by their name and the namespace they reside in.

Source for this file: /Webdav/src/property_storages/basic.php

Implements interfaces:

Version:   //autogen//

Descendants

Child Class Description
ezcWebdavFlaggedPropertyStorage Container class for ezcWebdavProperty objects with associated flags.

Member Variables

protected array $properties = array()
Stores the WebDAV properties.

The structure of this array is:

  1.  array(
  2.      'DAV:' => array(
  3.          '<live property name>' => ezcWebdavLiveProperty,
  4.          // ...
  5.      ),
  6.      '<another namespace URI>'array(
  7.          '<dead property name>' => ezcWebdavDeadProperty,
  8.          // ...
  9.      ),
  10.      // ...
  11.  )
protected array $propertyOrder = array()
Stores a list of the assigned properties in the order they were assigned, to make this order accessible for the Iterator.
protected int $propertyOrderNextId = 0
Next ID for a element in the ordered property list, to generate valid IDs even when some contents has been removed.
protected int $propertyOrderPosition = 0
Current position of the iterator in the ordered property list.

Method Summary

public void attach( $property )
Attaches a property to the storage.
public bool contains( $name , [ $namespace = 'DAV:'] )
Returns if the given property exists in the storage.
public int count( )
Return property count.
public ezcWebdavProperty current( )
Implements current() for Iterator.
public void detach( $name , [ $namespace = 'DAV:'] )
Detaches a property from the storage.
public ezcWebdavBasicPropertyStorage diff( $properties )
Diff two property storages.
public ezcWebdavProperty|null get( $name , [ $namespace = 'DAV:'] )
Returns a property from the storage.
public array(string=>array(string=>ezcWebdavProperty)) getAllProperties( )
Returns all properties contained in the storage.
public array(string=>ezcWebdavProperty) getProperties( [ $namespace = 'DAV:'] )
Returns all properties of a given namespace.
public ezcWebdavBasicPropertyStorage intersect( $properties )
Intersects between two property storages.
public int key( )
Implements key() for Iterator
public mixed next( )
Implements next() for Iterator
public void rewind( )
Implements rewind() for Iterator
public boolean valid( )
Implements valid() for Iterator
public void __clone( )
Clones the property storage deeply.

Methods

attach

void attach( ezcWebdavProperty $property )

Attaches a property to the storage.

Adds the given $property to the storage. The property can later be accessed by its name in combination with the namespace through the get() method. Live properties (and only these) reside in the namespace DAV:, which is the default for all accessor methods.

If a property with the same namespace and name is already contained in the storage, it will be overwritten.

Parameters:
Name Type Description
$property ezcWebdavProperty
Implementation of:
Method Description
ezcWebdavPropertyStorage::attach() Attaches a property to the storage.
Redefined in descendants as:
Method Description
ezcWebdavFlaggedPropertyStorage::attach() Attaches a property to the storage. 

contains

bool contains( string $name , [string $namespace = 'DAV:'] )

Returns if the given property exists in the storage.

Returns if the property with the given $name and $namespace is contained in the storage. If the $namespace parameter is omited, the default live property namespace ('DAV:') is used.

Parameters:
Name Type Description
$name string
$namespace string
Implementation of:
Method Description
ezcWebdavPropertyStorage::contains() Returns if the given property exists in the storage.

count

int count( )

Return property count.

Implementation required by interface Countable. Count the numbers of items contained by the instance. Will return the overall item count ignoring different namespaces.

current

ezcWebdavProperty current( )

Implements current() for Iterator.

Returns the currently selected element during iteration with foreach.

detach

void detach( string $name , [string $namespace = 'DAV:'] )

Detaches a property from the storage.

Removes the property with the given $name and $namespace from the storage. If the property does not exist in the storage, the call is silently ignored. If no $namespace is given, the default namespace for live properties ('DAV:') is used.

Parameters:
Name Type Description
$name string
$namespace string
Implementation of:
Method Description
ezcWebdavPropertyStorage::detach() Detaches a property from the storage.
Redefined in descendants as:
Method Description
ezcWebdavFlaggedPropertyStorage::detach() Detaches a property from the storage. 

diff

Diff two property storages.

Returns a property storage, which does only contain properties that are not present in the $properties parameter.

Parameters:
Name Type Description
$properties ezcWebdavPropertyStorage
Implementation of:
Method Description
ezcWebdavPropertyStorage::diff() Diff two property storages.

get

ezcWebdavProperty|null get( string $name , [string $namespace = 'DAV:'] )

Returns a property from the storage.

Returns the property with the given $name and $namespace. If the $namespace parameter is omitted, the default live property namespace ('DAV:') namespace is used. If the desired property is not contained in the storage, null is returned.

Parameters:
Name Type Description
$name string
$namespace string
Implementation of:
Method Description
ezcWebdavPropertyStorage::get() Returns a property from the storage.

getAllProperties

array(string=>array(string=>ezcWebdavProperty)) getAllProperties( )

Returns all properties contained in the storage.

Returns the complete array stored in $properties.

Implementation of:
Method Description
ezcWebdavPropertyStorage::getAllProperties() Returns all properties contained in the storage.

getProperties

array(string=>ezcWebdavProperty) getProperties( [string $namespace = 'DAV:'] )

Returns all properties of a given namespace.

The returned array is indexed by the property names. Live properties can be accessed by simply ommiting the $namespace parameter, since then the default namespace for live properties ('DAV:') is used.

Parameters:
Name Type Description
$namespace string
Implementation of:
Method Description
ezcWebdavPropertyStorage::getProperties() Returns all properties of a given namespace.

intersect

Intersects between two property storages.

Calculate and return an instance of ezcWebdavBasicPropertyStorage which contains the intersection of two property storages. This means a new property storage will be return which contains all values, which are present in the current and the given $properties property storage.

Parameters:
Name Type Description
$properties ezcWebdavPropertyStorage
Implementation of:
Method Description
ezcWebdavPropertyStorage::intersect() Intersects between two property storages.

key

int key( )

Implements key() for Iterator

Returns the key of the currently selected element during iteration with foreach.

next

mixed next( )

Implements next() for Iterator

Advances the internal pointer to the next element during iteration with foreach.

rewind

void rewind( )

Implements rewind() for Iterator

Resets the internal pointer to the first element before iteration with foreach.

valid

boolean valid( )

Implements valid() for Iterator

Returns if the internal pointer still points to a valid element when iteration with foreach. If this method returns false, iteration ends.

__clone

void __clone( )

Clones the property storage deeply.

Documentation generated by phpDocumentor 1.4.3