Skip to content

Commit fbf13bd

Browse files
committed
added nullable type for null values
1 parent 1761c96 commit fbf13bd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/DataModelGenerator/DataModelGenerator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,10 @@ protected function generateBaseEntities(): void
449449
$defaultValue = 'new ArrayCollection()';
450450
}
451451

452+
if ($defaultValue === 'null') {
453+
$phpDocType .= '|null';
454+
}
455+
452456
$property = new EntityClassProperty($targetName, $phpDocType, $defaultValue, [
453457
"@ORM\\$ormRelation(" . implode(', ', $ormColumnData) . ')',
454458
]);

0 commit comments

Comments
 (0)