diff --git a/src/Controller/ErnParserController.php b/src/Controller/ErnParserController.php index 432897c..d186fbc 100644 --- a/src/Controller/ErnParserController.php +++ b/src/Controller/ErnParserController.php @@ -262,7 +262,13 @@ private function instanciateClass($class_name) { if ($class_name === "\DateInterval") { // For DateInterval can't instanciate with null return new DateInterval("PT0M0S"); // will be erased - } else if ($class_name === "\DedexBundle\Entity\Ern382\EventDateTimeType") { + } + + if ($class_name === '\DateTime') { + return new $class_name(''); + } + + if ($class_name === "\DedexBundle\Entity\Ern382\EventDateTimeType") { return new \DedexBundle\Entity\Ern382\EventDateTimeType(new \DateTime()); // TODO }