Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Commit

Permalink
Support populating Doctrine's immutable date types
Browse files Browse the repository at this point in the history
  • Loading branch information
voronkovich committed Jan 3, 2019
1 parent 06ac73d commit 902683e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Faker/ORM/Doctrine/ColumnTypeGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ public function guessFormat($fieldName, ClassMetadata $class)
return function () use ($generator) {
return $generator->datetime;
};
case 'datetime_immutable':
case 'date_immutable':
case 'time_immutable':
return function () use ($generator) {
return \DateTimeImmutable::createFromMutable($generator->datetime);
};
default:
// no smart way to guess what the user expects here
return null;
Expand Down

0 comments on commit 902683e

Please sign in to comment.