variableToXml() public static method

"Convert" a PHP variable into an DOMElement object.
public static variableToXml ( mixed $variable, DOMDocument $document ) : DOMElement
$variable mixed
$document DOMDocument
return DOMElement
Exemplo n.º 1
0
 /**
  * Generate XML representation of this node's configuration.
  *
  * @param DOMElement $element
  * @ignore
  */
 public function configurationToXML(DOMElement $element)
 {
     $element->setAttribute('serviceObjectClass', $this->configuration['class']);
     if (!empty($this->configuration['arguments'])) {
         $xmlArguments = $element->appendChild($element->ownerDocument->createElement('arguments'));
         foreach ($this->configuration['arguments'] as $argument) {
             $xmlArguments->appendChild(ezcWorkflowDefinitionStorageXml::variableToXml($argument, $element->ownerDocument));
         }
     }
 }
Exemplo n.º 2
0
Arquivo: set.php Projeto: bmdevel/ezc
 /**
  * Generate XML representation of this node's configuration.
  *
  * @param DOMElement $element
  * @ignore
  */
 public function configurationToXML(DOMElement $element)
 {
     foreach ($this->configuration as $variable => $value) {
         $variableXml = $element->appendChild($element->ownerDocument->createElement('variable'));
         $variableXml->setAttribute('name', $variable);
         $variableXml->appendChild(ezcWorkflowDefinitionStorageXml::variableToXml($value, $element->ownerDocument));
     }
 }