*
{@link ezcWebdavPropPatchRequest::SET}
* {@link ezcWebdavPropPatchRequest::REMOVE}
*
*
* The default for this parameter does not have a meaning in terms of
* {@link ezcWebdavPropPatchRequest}.
*
* @param ezcWebdavProperty $property
* @param mixed $flag
* @return void
*/
public function attach( ezcWebdavProperty $property, $flag = 0 )
{
// Update list of ordered properties
if ( !isset( $this->properties[$property->namespace] ) ||
!isset( $this->properties[$property->namespace][$property->name] ) )
{
$this->propertyOrder[$this->propertyOrderNextId++] = array( $property->namespace, $property->name );
}
// Add property
$this->properties[$property->namespace][$property->name] = $property;
$this->flags[$property->namespace][$property->name] = $flag;
}
/**
* 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.
*
* @param string $name
* @param string $namespace
* @return void
*/
public function detach( $name, $namespace = 'DAV:' )
{
if ( isset( $this->properties[$namespace] ) &&
isset( $this->properties[$namespace][$name] ) )
{
unset( $this->properties[$namespace][$name] );
unset( $this->flags[$namespace][$name] );
}
}
/**
* Returns the flags for property.
*
* Returns the flags of a proerpty from the flagged property storage by the
* $name and optionally the $naemspace of the property. If no $namespace is
* given, the default namespace for live properties ('DAV:') is used.
*
* The method returns 0, if no flag has been explicitly assigned, and null,
* if the property does not exist in the storage.
*
* @param string $name
* @param string $namespace
* @return mixed
*/
public function getFlag( $name, $namespace = 'DAV:' )
{
if ( isset( $this->properties[$namespace] ) &&
isset( $this->properties[$namespace][$name] ) )
{
return $this->flags[$namespace][$name];
}
return null;
}
}
?>