lithium\test\Fixture::_alterRecord()
Apply the configured value mapping.
Parameters
-
array
$record
The record array.
Returns
arrayReturns the modified record.
Source
public function _alterRecord(array $record = []) {
$result = [];
foreach ($record as $name => $value) {
if (isset($this->_config['alters']['change'][$name])) {
$alter = $this->_config['alters']['change'][$name];
if (isset($alter['value'])) {
$function = $alter['value'];
$value = $function($record[$name]);
} else {
$value = $record[$name];
}
if (isset($alter['to'])) {
$result[$alter['to']] = $value;
} else {
$result[$name] = $value;
}
} else {
$result[$name] = $value;
}
}
return $result;
}