diff --git a/src/Entity/AbstractEntityService.php b/src/Entity/AbstractEntityService.php index 3d4fb9c..0d58cc5 100644 --- a/src/Entity/AbstractEntityService.php +++ b/src/Entity/AbstractEntityService.php @@ -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: