Horde_Kolab_Format_Xml_Type_Color
extends Horde_Kolab_Format_Xml_Type_String
in package
Handles a color attribute.
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
Table of Contents
- $default : string
- A default value if required.
- $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.
- _checkColor() : null
- Test if the input seems to be a real color.
Properties
$default
A default value if required.
protected
string
$default
$value
Indicate which value type is expected.
protected
int
$value
= \Horde_Kolab_Format_Xml::VALUE_MAYBE_MISSING
$_factory
The factory for any additional objects required.
private
Horde_Kolab_Format_Factory
$_factory
$_xml_types
Collects xml types already created.
private
static array<string|int, mixed>
$_xml_types
Methods
__construct()
Constructor
public
__construct(Horde_Kolab_Format_Factory $factory) : mixed
Parameters
- $factory : Horde_Kolab_Format_Factory
-
The factory for any additional objects required.
Return values
mixed —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
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
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
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
Return values
mixed —The default value.
_checkColor()
Test if the input seems to be a real color.
private
_checkColor(string $color, array<string|int, mixed> $params) : null
Parameters
- $color : string
-
The string to check.
- $params : array<string|int, mixed>
-
The parameters for this operation.