19 require_once(BASE.
"wcmf/lib/output/class.OutputStrategy.php");
37 $this->_writeValueProperties = $writeValueProperties;
60 $content[
'oid'] = $obj->getOID();
61 $content[
'type'] = $obj->getType();
62 $content[
'properties'] = array();
63 foreach($obj->getPropertyNames() as $name)
64 $content[
'properties'][$name] = $this->
writeValue($obj->getProperty($name));
66 $content[
'values'] = array();
67 foreach($obj->getDataTypes() as $type)
69 $content[
'values'][$type] = array();
70 foreach($obj->getValueNames($type) as $name)
72 $content[
'values'][$type][$name] = array();
73 $value = $this->
writeValue($obj->getValue($name, $type));
74 $content[
'values'][$type][$name][
'value'] = $value;
75 if ($this->_writeValueProperties)
77 $content[
'values'][$type][$name][
'properties'] = array();
78 foreach($obj->getValueProperties($name, $type) as $propertyName => $propertyValue)
79 $content[
'values'][$type][$name][
'properties'][$propertyName] = $this->
writeValue($propertyValue);
95 for ($i=0; $i<
sizeof($value); $i++)
96 array_push($content, utf8_encode($value[$i]));
98 else if (strtolower(get_class($value)) ==
'persistentobject' || is_a($value,
'PersistentObject'))
101 $content = utf8_encode($value);
OutputStrategy is used to write an object's content to a destination (called 'document') using a spec...
This OutputStrategy outputs an object's content into an array.
ArrayOutputStrategy($writeValueProperties=false)