-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DoctrineBridge] Add support for doctrin/dbal v2.6 types #22689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
i just wonder if the new types should add more |
@Hanmac we can't use the constants for the new types if we want to stay compatible with |
@jvasseur ah i thought the constants where in our part too. we might use the constants when we drop the support for the older versions. are the DBAL Type objects itself useful for this? i think no, but i am not sure PS: in the Guesser should |
The Type objects are not used by the guesser/property extractor, the decision is only done based on the name of the type. I'm 👎 for using |
The Form component supports reading immutable DateTime instances |
@stof but it can't write back I prefer to wait for proper support for |
ff5257c
to
0328a59
Compare
0328a59
to
b30fd4f
Compare
@@ -117,6 +117,15 @@ public function getTypes($class, $property, array $context = array()) | |||
case DBALType::TIME: | |||
return array(new Type(Type::BUILTIN_TYPE_OBJECT, $nullable, 'DateTime')); | |||
|
|||
case 'date_immutable': | |||
case 'datetime_immutable': | |||
case 'datetimetz_immutable': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have tests covering these three types, do we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only the time
type was tested (and not the date
, datetime
and datetimetz
) so I decided to do the same for the immutable variants.
@@ -1,6 +1,10 @@ | |||
CHANGELOG | |||
========= | |||
|
|||
3.4.0 | |||
----- | |||
* added support for doctrine/dbal v2.6 types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing blank line just before
Thank you @jvasseur. |
…es (jvasseur) This PR was merged into the 3.4 branch. Discussion ---------- [DoctrineBridge] Add support for doctrin/dbal v2.6 types | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT Add support for the following doctrine types in the property info extractor: - date_immutable - datetime_immutable - datetimetz_immutable - time_immutable - dateinterval I didn't include the json type since it can be anything that can be stored in a json. And add support for the dateinterval type for the form type guesser (the form component doesn't support using DateTimeImmutable instances). Commits ------- b30fd4f Add support for doctrin/dbal 2.6 types
Add support for the following doctrine types in the property info extractor:
I didn't include the json type since it can be anything that can be stored in a json.
And add support for the dateinterval type for the form type guesser (the form component doesn't support using DateTimeImmutable instances).