Getting embeddable should trigger entity initalization #5550

Closed
opened 2026-01-22 15:11:01 +01:00 by admin · 1 comment
Owner

Originally created by @mkosiedowski on GitHub (May 22, 2017).

Originally assigned to: @Ocramius on GitHub.

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

Originally created by @mkosiedowski on GitHub (May 22, 2017). Originally assigned to: @Ocramius on GitHub. 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`
admin added the Bug label 2026-01-22 15:11:01 +01:00
admin closed this issue 2026-01-22 15:11:01 +01:00
Author
Owner

@Ocramius commented on GitHub (Jun 1, 2017):

Handled in #6462

@Ocramius commented on GitHub (Jun 1, 2017): Handled in #6462
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5550