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

DDC-3303: @ORM\Embedded does not work with extending classes #4097

doctrinebot opened this Issue Sep 10, 2014 · 2 comments


None yet
4 participants
Copy link

doctrinebot commented Sep 10, 2014

Jira issue originally created by user TheBelgarion:

I update my symfony 2.5 with ORM 2.5. to try out the Embedded function.
I currently does not work correctly with extending class

 * @ORM\Entity
 * @ORM\Table(name="A", uniqueConstraints={@UniqueConstraint(name="id", columns={"id"})})
class A extends B {}
abstract class Item {

     * @var $bonus
     * @ORM\Embedded(class="Bonus")
    private $bonus;

it only works if i put the definition of the Embedded properties directly in class A ( but it works with all normal properties defined in the Abstract )


This comment has been minimized.

Copy link

doctrinebot commented Oct 1, 2015

Comment created by jpi:

Hi, I confirm this bug.
Im using Symfony 2.7.5 DBAL 2.5.2 ORM 2.5.1.

Error : Property xxx::$description does not exist


This comment has been minimized.

Copy link

martinopic commented May 1, 2016

Setting the parent class properties to "protected" (instead of private") works and could be an acceptable workaround for some.

lcobucci added a commit to lcobucci/doctrine2 that referenced this issue Jun 9, 2016

Allow the usage of embedded objects on parent classes.
The `ClassMetadataInfo` was always using the "current class" to
fetch the reflection of a property even when a field is declared
on the parent class (which causes `ReflectionProperty` to throw
an exception).

Fixes doctrine#4097 and doctrine#4277.

@Ocramius Ocramius added this to the 2.5.5 milestone Jun 19, 2016

@Ocramius Ocramius assigned Ocramius and unassigned beberlei Jun 19, 2016

Ocramius added a commit that referenced this issue Jun 19, 2016

@Ocramius Ocramius closed this in 3dfc180 Jun 19, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment