Exemplo n.º 1
0
 /**
  * Render a representation of a ResourceData object.
  *
  * @param   ResourceData  $resource  A resource data object.
  *
  * @return  A representation of the object.
  */
 public function renderResourceData(ResourceData $resource)
 {
     $xml = '';
     foreach ($resource->getProperties() as $name => $property) {
         $xml .= '<' . $name . '>' . $property->type->toExternal($property->internal) . '</' . $name . '>';
     }
     return $xml;
 }
Exemplo n.º 2
0
 /**
  * Render a representation of a ResourceData object.
  *
  * @param   ResourceData  $resource  A resource data object.
  *
  * @return  A representation of the object.
  */
 public function renderResourceData(ResourceData $resource)
 {
     $data = array();
     foreach ($resource->getProperties() as $name => $property) {
         $data[$name] = $property->type->toExternal($property->internal);
     }
     return $data;
 }