Embedded mapping cannot be overridden #5268

Open
opened 2026-01-22 15:03:07 +01:00 by admin · 1 comment
Owner

Originally created by @GrandLTU on GitHub (Sep 21, 2016).

When adding properties of embedded class to AttributeOverrides mapping fails.

 * @ORM\AttributeOverrides({
 *      @ORM\AttributeOverride(name="embedded.property1", column= @ORM\Column(nullable=true, type="date")),
 *      @ORM\AttributeOverride(name="embedded.property2", column= @ORM\Column(nullable=true, type="string")),
 * })

When adding overrides to the same class as where embeddable is added:

 $ bin/console doctrine:schema:validate


  [Doctrine\ORM\Mapping\MappingException]                                                          
  Invalid field override named 'embedded.property1' for class 'AppBundle\Entity\EnitityWithEmbedded'.

When adding overrides to class which extends class where embeddable is added:

bin/console doctrine:schema:validate


  [ReflectionException]                                                           
  Property AppBundle\Entity\EnitityWithEmbeddedExtended::$embedded.property1 does not exist  
Originally created by @GrandLTU on GitHub (Sep 21, 2016). When adding properties of embedded class to AttributeOverrides mapping fails. ``` * @ORM\AttributeOverrides({ * @ORM\AttributeOverride(name="embedded.property1", column= @ORM\Column(nullable=true, type="date")), * @ORM\AttributeOverride(name="embedded.property2", column= @ORM\Column(nullable=true, type="string")), * }) ``` When adding overrides to the same class as where embeddable is added: ``` $ bin/console doctrine:schema:validate [Doctrine\ORM\Mapping\MappingException] Invalid field override named 'embedded.property1' for class 'AppBundle\Entity\EnitityWithEmbedded'. ``` When adding overrides to class which extends class where embeddable is added: ``` bin/console doctrine:schema:validate [ReflectionException] Property AppBundle\Entity\EnitityWithEmbeddedExtended::$embedded.property1 does not exist ```
Author
Owner

@Padam87 commented on GitHub (Oct 12, 2016):

Is this a bug, or a missing feature? There really should be a way to modify embeddables on a per-case basis.

@Padam87 commented on GitHub (Oct 12, 2016): Is this a bug, or a missing feature? There really should be a way to modify embeddables on a per-case basis.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5268