62 foreach (get_object_vars($valueObject) as
$key => $val) {
66 foreach ($val as $child) {
70 } elseif ($val !== null) {
99 foreach ($items as $item) {
166 if (is_scalar($value)) {
169 $writer->text($value);
174 $value->xmlSerialize($writer);
176 } elseif (is_object($value) && isset($writer->classMap[get_class($value)])) {
179 $writer->classMap[get_class($value)]($writer, $value);
181 } elseif (is_callable($value)) {
186 } elseif (is_null($value)) {
190 } elseif (is_array($value) && array_key_exists(
'name', $value)) {
195 $name = $value[
'name'];
196 $attributes = isset($value[
'attributes']) ? $value[
'attributes'] : [];
197 $value = isset($value[
'value']) ? $value[
'value'] : null;
201 $writer->
write($value);
202 $writer->endElement();
204 } elseif (is_array($value)) {
206 foreach ($value as
$name => $item) {
214 } elseif (is_string(
$name) && is_array($item) && isset($item[
'attributes'])) {
220 if (isset($item[
'value'])) {
221 $writer->
write($item[
'value']);
223 $writer->endElement();
225 } elseif (is_string(
$name)) {
229 $writer->
write($item);
230 $writer->endElement();
239 } elseif (is_object($value)) {
if($err=$client->getError()) $namespace
Objects implementing XmlSerializable can control how they are represented in Xml. ...
repeatingElements(Writer $writer, array $items, $childElementName)
This serializer helps you serialize xml structures that look like this:
startElement($name)
Opens a new element.
valueObject(Writer $writer, $valueObject, $namespace)
The valueObject serializer turns a simple PHP object into a classname.
standardSerializer(Writer $writer, $value)
This function is the 'default' serializer that is able to serialize most things, and delegates to oth...
if(array_key_exists('yes', $_REQUEST)) $attributes
writeAttributes(array $attributes)
Writes a list of attributes.
write($value)
Writes a value to the output stream.
writeElement($name, $content=null)
Write a full element tag and it's contents.