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?

in Solved by (320 points)
recategorized by

1 Answer

0 votes
Best answer

Sure, embeddables are fully supported.

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

by Skipper developer (141k points)
selected by

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.