Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DoctrineBridge] Don't rely on ClassMetadataInfo->hasField in DoctrineOrmTypeGuesser anymore#26567
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…eOrmTypeGuesser anymore
| // Check whether the field exists and is nullable or not | ||
| if ($classMetadata->hasField($property)) { | ||
| if (isset($classMetadata->fieldMappings[$property])) { | ||
| if (!$classMetadata->isNullable($property) && Type::BOOLEAN !==$classMetadata->getTypeOfField($property)) { |
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.
isNullable callsgetFieldMapping internally
| { | ||
| $ret =$this->getMetadata($class); | ||
| if ($ret &&$ret[0]->hasField($property) && !$ret[0]->hasAssociation($property)) { | ||
| if ($ret &&isset($ret[0]->fieldMappings[$property]) && !$ret[0]->hasAssociation($property)) { |
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.
This one is not needed but I did it for consistency.
fancyweb commentedMar 16, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
If checking the public property is not clean enough, there are other ways of doing it. |
Tobion left a comment
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.
LGTM, thanks for the fix
fabpot commentedMar 18, 2018
Thank you@fancyweb. |
… in DoctrineOrmTypeGuesser anymore (fancyweb)This PR was merged into the 2.7 branch.Discussion----------[DoctrineBridge] Don't rely on ClassMetadataInfo->hasField in DoctrineOrmTypeGuesser anymore| Q | A| ------------- | ---| Branch? | 2.7| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#26543| License | MIT| Doc PR | -Discussion and explanations in the linked issue#26543Commits-------f656dc2 [DoctrineBridge] Don't rely on ClassMetadataInfo->hasField in DoctrineOrmTypeGuesser anymore
pink6440 commentedMar 19, 2018
@fancyweb nice and quick work ! thanks ! |
Discussion and explanations in the linked issue#26543