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

Closed
opened 2026-01-22 14:34:54 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Sep 10, 2014).

Originally assigned to: @Ocramius on GitHub.

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 )

Originally created by @doctrinebot on GitHub (Sep 10, 2014). Originally assigned to: @Ocramius on GitHub. 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 )
admin added the Bug label 2026-01-22 14:34:54 +01:00
admin closed this issue 2026-01-22 14:34:54 +01:00
Author
Owner

@doctrinebot commented on GitHub (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

@doctrinebot commented on GitHub (Oct 1, 2015): Comment created by jpi: Hi, **I confirm this bug**. Im using Symfony 2.7.5 <ins> DBAL 2.5.2 </ins> ORM 2.5.1. Error : Property xxx::$description does not exist
Author
Owner

@martinopic commented on GitHub (May 1, 2016):

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

@martinopic commented on GitHub (May 1, 2016): Setting the parent class properties to "protected" (instead of private") works and could be an acceptable workaround for some.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4084