Class: I2CE MagicDataTemplate YAML: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
This article desrcibes the class '''I2CE_MagicDataTemplate_YAML''' | This article desrcibes the class '''I2CE_MagicDataTemplate_YAML'''. | ||
*Extends the class: [[Class: I2CE_MagicDataTemplate | I2CE_MagicDataTemplate]]. | |||
It is contained in the module [[iHRIS Module List#YAML_spyc|YAML_spyc]] in the package [https://launchpad.net/i2ce I2CE] | It is contained in the module [[iHRIS Module List#YAML_spyc|YAML_spyc]] in the package [https://launchpad.net/i2ce I2CE] | ||
Line 22: | Line 23: | ||
*Returns: booolean true on success | *Returns: booolean true on success | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/language.types.array.php array] $data<br/>The data for the current node | * [http://www.php.net/manual/en/language.types.array.php array ] $data<br/>The data for the current node | ||
* [http://www.php.net/manual/en/language.types.string.php string] $name<br/>The name for the current node. | * [http://www.php.net/manual/en/language.types.string.php string ] $name<br/>The name for the current node. | ||
* [http://www.php.net/manual/en/class.domnode.php | * [http://www.php.net/manual/en/class.domnode.php DOMNode ] $node<br/>The parent node we wish to add onto node | ||
* [http://www.php.net/manual/en/language.types.array.php array] $status<br/>The status of the parent node. | * [http://www.php.net/manual/en/language.types.array.php array ] $status<br/>The status of the parent node. | ||
===convertMetaDataArray()=== | ===convertMetaDataArray()=== | ||
Converts the a metadata array to the metadata DOM node. | Converts the a metadata array to the metadata DOM node. | ||
Line 31: | Line 32: | ||
*Returns: boolean. true on sucess | *Returns: boolean. true on sucess | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/language.types.array.php array] $data<br/>for netadata | * [http://www.php.net/manual/en/language.types.array.php array ] $data<br/>for netadata | ||
===loadFromYAMLArray()=== | ===loadFromYAMLArray()=== | ||
Load an array loaded from a YAML config file to the DOM | Load an array loaded from a YAML config file to the DOM | ||
Example of YAML config portion is in sample.yaml | Example of YAML config portion is in sample.yaml | ||
*Signature: public function loadFromYAMLArray($data) | *Signature: public function loadFromYAMLArray($data) | ||
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean] True on success | *Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] True on success | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/language.types.array.php array] $data<br/>An array containing configuration data from a YAML config file | * [http://www.php.net/manual/en/language.types.array.php array ] $data<br/>An array containing configuration data from a YAML config file | ||
===processYAML_status()=== | ===processYAML_status()=== | ||
Default processor for a YAML status key,value pair | Default processor for a YAML status key,value pair | ||
Line 44: | Line 45: | ||
*Signature: protected function processYAML_status($key,$val) | *Signature: protected function processYAML_status($key,$val) | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/language.types.string.php string] $key | * [http://www.php.net/manual/en/language.types.string.php string ] $key | ||
* [http://www.php.net/manual/en/language.pseudo-types.php mixed] $val | * [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $val | ||
===processYAML_status_list()=== | ===processYAML_status_list()=== | ||
Processor for a YAML status key,value pair where $key='list' | Processor for a YAML status key,value pair where $key='list' | ||
Line 51: | Line 52: | ||
*Signature: protected function processYAML_status_list($key,$val) | *Signature: protected function processYAML_status_list($key,$val) | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/language.types.string.php string] $key | * [http://www.php.net/manual/en/language.types.string.php string ] $key | ||
* [http://www.php.net/manual/en/language.pseudo-types.php mixed] $val | * [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $val | ||
===processYAML_values_boolean()=== | ===processYAML_values_boolean()=== | ||
Process YAML config data where __type ='boolean' | Process YAML config data where __type ='boolean' | ||
*Signature: protected function processYAML_values_boolean($values,$status) | *Signature: protected function processYAML_values_boolean($values,$status) | ||
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed] array on success containing each value of which will be the content of a <value> node, or false on failure | *Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ] array on success containing each value of which will be the content of a <value> node, or false on failure | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/language.pseudo-types.php mixed] $values<br/>The configdata for the key '__values' | * [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $values<br/>The configdata for the key '__values' | ||
* [http://www.php.net/manual/en/language.types.array.php array] $status<br/>The status of the configuration node | * [http://www.php.net/manual/en/language.types.array.php array ] $status<br/>The status of the configuration node | ||
===processYAML_values_delimited()=== | ===processYAML_values_delimited()=== | ||
Process YAML config data where __type ='delimited' | Process YAML config data where __type ='delimited' | ||
*Signature: protected function processYAML_values_delimited($values,$status) | *Signature: protected function processYAML_values_delimited($values,$status) | ||
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed] array on success containing each value of which will be the content of a <value> node, or false on failure | *Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ] array on success containing each value of which will be the content of a <value> node, or false on failure | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/language.pseudo-types.php mixed] $values<br/>The configdata for the key '__values' | * [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $values<br/>The configdata for the key '__values' | ||
* [http://www.php.net/manual/en/language.types.array.php array] $status<br/>The status of the configuration node | * [http://www.php.net/manual/en/language.types.array.php array ] $status<br/>The status of the configuration node | ||
===processYAML_values_list()=== | ===processYAML_values_list()=== | ||
Process YAML config data where __type ='list' | Process YAML config data where __type ='list' | ||
*Signature: protected function processYAML_values_list($values,$status) | *Signature: protected function processYAML_values_list($values,$status) | ||
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed] array on success containing each value of which will be the content of a <value> node, or false on failure | *Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ] array on success containing each value of which will be the content of a <value> node, or false on failure | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/language.pseudo-types.php mixed] $values<br/>The configdata for the key '__values' | * [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $values<br/>The configdata for the key '__values' | ||
* [http://www.php.net/manual/en/language.types.array.php array] $status<br/>The status of the configuration node | * [http://www.php.net/manual/en/language.types.array.php array ] $status<br/>The status of the configuration node | ||
===processYAML_values_string()=== | ===processYAML_values_string()=== | ||
Process YAML config data where __type ='string' or is not set | Process YAML config data where __type ='string' or is not set | ||
*Signature: protected function processYAML_values_string($values,$status) | *Signature: protected function processYAML_values_string($values,$status) | ||
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed] array on success containing each value of which will be the content of a <value> node, or false on failure | *Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ] array on success containing each value of which will be the content of a <value> node, or false on failure | ||
Parameters: | Parameters: | ||
* [http://www.php.net/manual/en/language.pseudo-types.php mixed] $values<br/>The configdata for the key '__values' | * [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $values<br/>The configdata for the key '__values' | ||
* [http://www.php.net/manual/en/language.types.array.php array] $status<br/>The status of the configuration node | * [http://www.php.net/manual/en/language.types.array.php array ] $status<br/>The status of the configuration node | ||
==Inherited Variables== | ==Inherited Variables== | ||
===$merges=== | ===$merges=== |
Revision as of 21:25, 16 October 2009
This article desrcibes the class I2CE_MagicDataTemplate_YAML.
- Extends the class: I2CE_MagicDataTemplate.
It is contained in the module YAML_spyc in the package I2CE
The class is defined in the file: modules/YAML/lib/I2CE_MagicDataTemplate_YAML.php
I2CE_MagicDataTemplate_YAML @subpackage Core
- Author: Carl Leitner <litlfred@ibiblio.org>
Variables
$attributeConversion
an array to conver attribbutes for yaml keys in a config data to DOMElement attributes
- Type: static protected $attributeConversion
$optionalNodes
an array to convert attribbutes for yaml keys in a config data to optional subnode of a DOMNode
- Type: static protected $optionalNodes
Methods
convertConfigDataArray()
Converts configurationGroup data in an array to its DOM representation.
- Signature: protected function convertConfigDataArray($data,$name,$node,$status)
- Returns: booolean true on success
Parameters:
- array $data
The data for the current node - string $name
The name for the current node. - DOMNode $node
The parent node we wish to add onto node - array $status
The status of the parent node.
convertMetaDataArray()
Converts the a metadata array to the metadata DOM node.
- Signature: protected function convertMetaDataArray($data)
- Returns: boolean. true on sucess
Parameters:
- array $data
for netadata
loadFromYAMLArray()
Load an array loaded from a YAML config file to the DOM Example of YAML config portion is in sample.yaml
- Signature: public function loadFromYAMLArray($data)
- Returns: boolean True on success
Parameters:
- array $data
An array containing configuration data from a YAML config file
processYAML_status()
Default processor for a YAML status key,value pair $returns mixed. string on success, the text content of the <status> node that should be created. false on failure
- Signature: protected function processYAML_status($key,$val)
Parameters:
processYAML_status_list()
Processor for a YAML status key,value pair where $key='list' $returns mixed. string on success, the text content of the <status> node that should be created. false on failure
- Signature: protected function processYAML_status_list($key,$val)
Parameters:
processYAML_values_boolean()
Process YAML config data where __type ='boolean'
- Signature: protected function processYAML_values_boolean($values,$status)
- Returns: mixed array on success containing each value of which will be the content of a <value> node, or false on failure
Parameters:
- mixed $values
The configdata for the key '__values' - array $status
The status of the configuration node
processYAML_values_delimited()
Process YAML config data where __type ='delimited'
- Signature: protected function processYAML_values_delimited($values,$status)
- Returns: mixed array on success containing each value of which will be the content of a <value> node, or false on failure
Parameters:
- mixed $values
The configdata for the key '__values' - array $status
The status of the configuration node
processYAML_values_list()
Process YAML config data where __type ='list'
- Signature: protected function processYAML_values_list($values,$status)
- Returns: mixed array on success containing each value of which will be the content of a <value> node, or false on failure
Parameters:
- mixed $values
The configdata for the key '__values' - array $status
The status of the configuration node
processYAML_values_string()
Process YAML config data where __type ='string' or is not set
- Signature: protected function processYAML_values_string($values,$status)
- Returns: mixed array on success containing each value of which will be the content of a <value> node, or false on failure
Parameters:
- mixed $values
The configdata for the key '__values' - array $status
The status of the configuration node
Inherited Variables
$merges
Theis protected variable is inherited from I2CE_MagicDataTemplate->$merges
$doc
Theis public variable is inherited from I2CE_TemplateMeister->$doc
$xpath
Theis protected variable is inherited from I2CE_TemplateMeister->$xpath
$user
Theis protected variable is inherited from I2CE_TemplateMeister->$user
$working_dir
Theis protected variable is inherited from I2CE_TemplateMeister->$working_dir
$loadOptions
Theis protected variable is inherited from I2CE_TemplateMeister->$loadOptions
$headers
Theis protected variable is inherited from I2CE_TemplateMeister->$headers
$verboseErrors
Theis protected variable is inherited from I2CE_TemplateMeister->$verboseErrors
Inherited Fuzzy Methods
processValues_color_triple_hex_single()
This method is inherited from I2CE_MagicDataTemplate->processValues_color_triple_hex_single()
processValues_color_triple_hex_many()
This method is inherited from I2CE_MagicDataTemplate->processValues_color_triple_hex_many()
processValues_color_triple_rgb_single()
This method is inherited from I2CE_MagicDataTemplate->processValues_color_triple_rgb_single()
processValues_color_triple_rgb_many()
This method is inherited from I2CE_MagicDataTemplate->processValues_color_triple_rgb_many()
processValues_color_hex_single()
This method is inherited from I2CE_MagicDataTemplate->processValues_color_hex_single()
processValues_color_hex_many()
This method is inherited from I2CE_MagicDataTemplate->processValues_color_hex_many()
userMessage()
This method is inherited from I2CE_Fuzzy->userMessage()