Home Documentation Download Pricing Buy Now

[Solved] Support embedding value objects in Doctrine

0 votes

Is there currently support for embedding value objects to Doctrine entities?
http://docs.doctrine-project.org/en/latest/tutorials/embeddables.html

At least, I couldn't find a way to do it.
If not, could you please consider adding support for it?

asked Apr 9, 2016 in Solved by cvuorinen (320 points)
recategorized May 28, 2016 by ludek.vodicka

1 Answer

0 votes
 
Best answer

Sure, embeddables are fully supported.

http://i.imgur.com/3N5JeEk.png

answered Apr 9, 2016 by ludek.vodicka Skipper developer (140,530 points)
selected Apr 11, 2016 by cvuorinen

Yes, I saw that. But how can it be used to embed a value object that is not an entity?

I would like to have a value object that lives in a separate namespace from entities and does not have the @ORM\Entity annotation, and has @ORM\Embeddable annotation instead (as in the example I linked to in the question).

As soon as you embed entity object it automatically becomes value object.

Feel free to try it in Skipper and in case that export will not be what you need please post expected schema file together with your Skipper file so we can help you

Ok, that works. Thanks!

Just wasn't that intuitive to create an entity when I wanted a value object.

...