Skip to content
Snippets Groups Projects
Commit 65d73a35 authored by jaapjansma's avatar jaapjansma
Browse files

Added denormalize value for default data

parent 4200edb9
No related branches found
No related tags found
No related merge requests found
......@@ -184,7 +184,11 @@
$return = array();
foreach($formProcessor['default_data_output_configuration'] as $field => $alias) {
$return[$field] = $dataBag->getDataByAlias($alias);
foreach($formProcessor['inputs'] as $input) {
if ($input['name'] == $field) {
$return[$field] = $input['type']->denormalizeValue($dataBag->getDataByAlias($alias));
}
}
}
return $return;
}
......
......@@ -134,6 +134,17 @@
public function normalizeValue($value) {
return $value;
}
/**
* Denormalize the input value.
*
* @param $value
*
* @return mixed
*/
public function denormalizeValue($value) {
return $value;
}
/**
* @param ConfigurationBag $configuration
......
......@@ -73,6 +73,21 @@
}
return $value;
}
/**
* Denormalize the input value.
*
* @param $value
*
* @return mixed
*/
public function denormalizeValue($value) {
if ($value) {
$date = new \DateTime($value);
return $date->format($this->configuration->get('format'));
}
return $value;
}
/**
* Validate the value
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment