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
示例#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));
         }
     }
 }
示例#2
0
文件: set.php 项目: 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));
     }
 }