Documentation

Horde_Kolab_Format_Xml_Type_Composite_SimplePerson extends Horde_Kolab_Format_Xml_Type_Composite
in package

Handles attributes to represent a person in a simple way.

Copyright 2011-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.

Tags
category

Kolab

author

Gunnar Wrobel wrobel@pardus.de

license

http://www.horde.org/licenses/lgpl21 LGPL

link
http://www.horde.org/libraries/Horde_Kolab_Format

Table of Contents

$default  : string
A default value if required.
$elements  : array<string|int, mixed>
The elements of the composite attribute.
$merge  : bool
Should the values be merged into the parent attributes?
$value  : int
Indicate which value type is expected.
$_factory  : Horde_Kolab_Format_Factory
The factory for any additional objects required.
$_xml_types  : array<string|int, mixed>
Collects xml types already created.
__construct()  : mixed
Constructor
getParam()  : mixed
Return a parameter value.
load()  : DOMNode|bool
Load the node value from the Kolab object.
loadNodeValue()  : mixed|null
Load the value of a node.
save()  : DOMNode|bool
Update the specified attribute.
saveNodeValue()  : DOMNode|bool
Update the specified attribute.
checkMissing()  : mixed
Validate that the parameter array contains all required parameters.
createSubType()  : Horde_Kolab_Format_Xml_Type
Create a handler for the sub type of this attribute.
generateWriteValue()  : mixed
Generate the value that should be written to the node. Override in the extending classes.
isRelaxed()  : bool
Returns if the XML handling should be relaxed.
loadMissing()  : mixed
Load a default value for a node.
_writeComposite()  : array<string|int, mixed>
Write a composite value to a parent node.

Properties

$default

A default value if required.

protected string $default

$elements

The elements of the composite attribute.

protected array<string|int, mixed> $elements = array('display-name' => 'Horde_Kolab_Format_Xml_Type_String_Empty', 'smtp-address' => 'Horde_Kolab_Format_Xml_Type_String_Empty', 'uid' => 'Horde_Kolab_Format_Xml_Type_String_Empty')

$merge

Should the values be merged into the parent attributes?

protected bool $merge = \false

$value

Indicate which value type is expected.

protected int $value = \Horde_Kolab_Format_Xml::VALUE_MAYBE_MISSING

$_xml_types

Collects xml types already created.

private static array<string|int, mixed> $_xml_types

Methods

getParam()

Return a parameter value.

public getParam(string $name) : mixed
Parameters
$name : string

The parameter name.

Return values
mixed

The parameter value.

load()

Load the node value from the Kolab object.

public load(string $name, array<string|int, mixed> &$attributes, DOMNode $parent_node, Horde_Kolab_Format_Xml_Helper $helper[, array<string|int, mixed> $params = array() ]) : DOMNode|bool
Parameters
$name : string

The name of the the attribute to be fetched.

$attributes : array<string|int, mixed>

The data array that holds all attribute values.

$parent_node : DOMNode

The parent node of the node to be loaded.

$helper : Horde_Kolab_Format_Xml_Helper

A XML helper instance.

$params : array<string|int, mixed> = array()

Additiona parameters for this parse operation.

Return values
DOMNode|bool

The named DOMNode or false if no node value was found.

loadNodeValue()

Load the value of a node.

public loadNodeValue(DOMNode $node, Horde_Kolab_Format_Xml_Helper $helper[, array<string|int, mixed> $params = array() ]) : mixed|null
Parameters
$node : DOMNode

Retrieve value for this node.

$helper : Horde_Kolab_Format_Xml_Helper

A XML helper instance.

$params : array<string|int, mixed> = array()

Additiona parameters for this parse operation.

Return values
mixed|null

The value or null if no value was found.

save()

Update the specified attribute.

public save(string $name, array<string|int, mixed> $attributes, DOMNode $parent_node, Horde_Kolab_Format_Xml_Helper $helper[, array<string|int, mixed> $params = array() ]) : DOMNode|bool
Parameters
$name : string

The name of the the attribute to be updated.

$attributes : array<string|int, mixed>

The data array that holds all attribute values.

$parent_node : DOMNode

The parent node of the node that should be updated.

$helper : Horde_Kolab_Format_Xml_Helper

A XML helper instance.

$params : array<string|int, mixed> = array()

Additional parameters for this write operation.

Tags
throws
Horde_Kolab_Format_Exception

If converting the data to XML failed.

Return values
DOMNode|bool

The new/updated child node or false if this failed.

saveNodeValue()

Update the specified attribute.

public saveNodeValue(string $name, mixed $value, DOMNode $parent_node, Horde_Kolab_Format_Xml_Helper $helper[, array<string|int, mixed> $params = array() ][, DOMNode|null $old_node = false ]) : DOMNode|bool
Parameters
$name : string

The name of the attribute to be updated.

$value : mixed

The value to store.

$parent_node : DOMNode

The parent node of the node that should be updated.

$helper : Horde_Kolab_Format_Xml_Helper

A XML helper instance.

$params : array<string|int, mixed> = array()

The parameters for this write operation.

$old_node : DOMNode|null = false

The previous value (or null if there is none).

Tags
throws
Horde_Kolab_Format_Exception

If converting the data to XML failed.

Return values
DOMNode|bool

The new/updated child node or false if this failed.

checkMissing()

Validate that the parameter array contains all required parameters.

protected checkMissing(string $key, array<string|int, mixed> $params, string $attribute) : mixed
Parameters
$key : string

The parameter name.

$params : array<string|int, mixed>

The parameters.

$attribute : string

The attribute name.

Tags
throws
Horde_Kolab_Format_Exception

In case required parameters are missing.

Return values
mixed

createSubType()

Create a handler for the sub type of this attribute.

protected createSubType(string $type, array<string|int, mixed> $params) : Horde_Kolab_Format_Xml_Type
Parameters
$type : string

The sub type.

$params : array<string|int, mixed>

Additional parameters.

Return values
Horde_Kolab_Format_Xml_Type

The sub type handler.

generateWriteValue()

Generate the value that should be written to the node. Override in the extending classes.

protected generateWriteValue(string $name, array<string|int, mixed> $attributes, array<string|int, mixed> $params) : mixed
Parameters
$name : string

The name of the the attribute to be updated.

$attributes : array<string|int, mixed>

The data array that holds all attribute values.

$params : array<string|int, mixed>

The parameters for this write operation.

Return values
mixed

The value to be written.

isRelaxed()

Returns if the XML handling should be relaxed.

protected isRelaxed(array<string|int, mixed> $params) : bool
Parameters
$params : array<string|int, mixed>

The parameters.

Return values
bool

True if the XML should not be strict.

loadMissing()

Load a default value for a node.

protected loadMissing(string $name, array<string|int, mixed> $params) : mixed
Parameters
$name : string

The attribute name.

$params : array<string|int, mixed>

The parameters for the current operation.

Tags
throws
Horde_Kolab_Format_Exception

In case the attribute may not be missing or the default value was left undefined.

Return values
mixed

The default value.

_writeComposite()

Write a composite value to a parent node.

private _writeComposite(DOMNode $parent_node, string $name, array<string|int, mixed> $values, Horde_Kolab_Format_Xml_Helper $helper, array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$parent_node : DOMNode

The parent node of the node that should be updated.

$name : string

The name of the the attribute to be updated.

$values : array<string|int, mixed>

The values to write.

$helper : Horde_Kolab_Format_Xml_Helper

A XML helper instance.

$params : array<string|int, mixed>

The parameters for this write operation.

Tags
throws
Horde_Kolab_Format_Exception

If converting the data to XML failed.

Return values
array<string|int, mixed>

The list of new/updated child nodes.

Search results