orm icon indicating copy to clipboard operation
orm copied to clipboard

Embedded mapping cannot be overridden

Open GrandLTU opened this issue 10 years ago • 1 comments

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  

GrandLTU avatar Sep 21 '16 08:09 GrandLTU

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

Padam87 avatar Oct 12 '16 14:10 Padam87