/** * 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; }
/** * 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; }