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

Commit

Permalink
Merge pull request #1639 from voronkovich/populate-date-time-immutable
Browse files Browse the repository at this point in the history
Support populating Doctrine's immutable date types
  • Loading branch information
fzaninotto committed Jan 9, 2019
2 parents 06ac73d + 902683e commit 76b1c25
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 76b1c25

Please sign in to comment.