"Convert" a PHP variable into an DOMElement object.
public static variableToXml ( mixed $variable, DOMDocument $document ) : DOMElement | ||
$variable | mixed | |
$document | DOMDocument | |
Результат | DOMElement |
/** * 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)); } } }
/** * 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)); } }