variableToXml() public static méthode

"Convert" a PHP variable into an DOMElement object.
public static variableToXml ( mixed $variable, DOMDocument $document ) : DOMElement
$variable mixed
$document DOMDocument
Résultat DOMElement
Exemple #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));
         }
     }
 }
Exemple #2
0
 /**
  * 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));
     }
 }