Skip to content

Commit

Permalink
[HF] Correction du cas des dates
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume DUBOST committed May 29, 2019
1 parent e0e9a90 commit 2c33418
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Entity/AbstractEntityService.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ protected function setPropertiesToEntity(array $datas, array $validation_groups,
case 1 === preg_match(
"#^(date|datetime|time)[a-z_]*$#",
$doctrine_field_metadata[$field_name]["type"]
) && is_string($data_value):
$filtered_datas[$field_name] = new \DateTime($data_value);
):
if (is_string($data_value)) {
$filtered_datas[$field_name] = new \DateTime($data_value);
}
break;
// Sinon on sette tel quel
default:
Expand Down

0 comments on commit 2c33418

Please sign in to comment.