Skip to content
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

Getting embeddable should trigger entity initalization #6460

Closed
mkosiedowski opened this issue May 22, 2017 · 1 comment · Fixed by #6462
Closed

Getting embeddable should trigger entity initalization #6460

mkosiedowski opened this issue May 22, 2017 · 1 comment · Fixed by #6462
Assignees
Labels
Milestone

Comments

@mkosiedowski
Copy link
Contributor

Getting public embeddables on lazy-loaded entity which is not initialized does not trigger entity initialization.

Common ProxyGenerator in \Doctrine\Common\Proxy\ProxyGenerator::getLazyLoadedPublicProperties uses code:

if (($class->hasField($name) || $class->hasAssociation($name)) && ! $class->isIdentifier($name)) {
    $properties[$name] = $defaultProperties[$name];
}

The interface \Doctrine\Common\Persistence\Mapping\ClassMetadata cannot be extended without breaking backward compatibility so ORM has to return true for embeddables either in hasField or in hasAssociation. In my opinion this should be hasField

mkosiedowski added a commit to mkosiedowski/doctrine-doctrine2 that referenced this issue May 22, 2017
@Ocramius Ocramius added this to the 2.6.0 milestone Jun 1, 2017
@Ocramius Ocramius self-assigned this Jun 1, 2017
@Ocramius Ocramius added the Bug label Jun 1, 2017
@Ocramius
Copy link
Member

Ocramius commented Jun 1, 2017

Handled in #6462

Ocramius added a commit that referenced this issue Jun 1, 2017
Fix #6460 - \Doctrine\ORM\Mapping\ClassMetadataInfo::hasField should return true for embedded fields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants