Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Merged

Conversation

@fancyweb
Copy link
Contributor

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#26543
LicenseMIT
Doc PR-

Discussion and explanations in the linked issue#26543

// 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)) {
Copy link
ContributorAuthor

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)) {
Copy link
ContributorAuthor

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.

@nicolas-grekasnicolas-grekas added this to the2.7 milestoneMar 16, 2018
@fancyweb
Copy link
ContributorAuthor

fancyweb commentedMar 16, 2018
edited
Loading

If checking the public property is not clean enough, there are other ways of doing it.

Copy link
Contributor

@TobionTobion left a 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
Copy link
Member

Thank you@fancyweb.

@fabpotfabpot merged commitf656dc2 intosymfony:2.7Mar 18, 2018
fabpot added a commit that referenced this pull requestMar 18, 2018
… 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
@fancywebfancyweb deleted the doctrine-orm-type-guesser-has-field branchMarch 18, 2018 19:44
@pink6440
Copy link

@fancyweb nice and quick work ! thanks !

This was referencedApr 2, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

+2 more reviewers

@TobionTobionTobion approved these changes

@20uf20uf20uf approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

2.7

Development

Successfully merging this pull request may close these issues.

7 participants

@fancyweb@fabpot@pink6440@Tobion@20uf@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp