DDC-3467: Embeddable in inheritance currently must be protected #4274

Open
opened 2026-01-22 14:38:36 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Dec 30, 2014).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user nemo64:

I have a setup similar to this one :

/****
 * @ORM\Table()
 * @ORM\Entity(readOnly=true)
 * @ORM\InheritanceType("SINGLE_TABLE")
 ****/
abstract class Planet
{
    /** ... **/
    /****
     * @var Position
     * @ORM\Embedded(class="Position")
     */
    private $position;
}
/****
 * @ORM\Entity(readOnly=true)
 ****/
class Sun extends Planet
{
}

This causes the following error:

[ReflectionException]
Property Sun::$position does not exist

This can easily be fixed by making the embeddable protected, but if I didn't miss anything, a private embed should work too.

Originally created by @doctrinebot on GitHub (Dec 30, 2014). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user nemo64: I have a setup similar to this one : ``` /**** * @ORM\Table() * @ORM\Entity(readOnly=true) * @ORM\InheritanceType("SINGLE_TABLE") ****/ abstract class Planet { /** ... **/ /**** * @var Position * @ORM\Embedded(class="Position") */ private $position; } ``` ``` /**** * @ORM\Entity(readOnly=true) ****/ class Sun extends Planet { } ``` This causes the following error: ``` [ReflectionException] Property Sun::$position does not exist ``` This can easily be fixed by making the embeddable protected, but if I didn't miss anything, a private embed should work too.
admin added the Bug label 2026-01-22 14:38:36 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4274