protected function ServicesClientFieldFormatter::formatArray in Services Client 7.2
Format source value array to field.
Parameters
array $values: Source values that should be formatted.
Return value
array Formatted value in format
1 call to ServicesClientFieldFormatter::formatArray()
- ServicesClientFieldFormatter::format in include/
mapping.inc - Format source value to destination.
1 method overrides ServicesClientFieldFormatter::formatArray()
- ServicesClientFieldD6Formatter::formatArray in include/
mapping.inc - Format source value array to field.
File
- include/
mapping.inc, line 699
Class
Code
protected function formatArray($values) {
// Make handy shortcuts
$language = $this->config['language'];
$field = $this->config['field'];
$property = $this->config['property'];
// Build final value
$out = array();
foreach ($values as $value) {
$out[$language][][$property] = $value;
}
// Return resulting value.
return array(
'key' => $this->config['field'],
'value' => $out,
);
}