I've this two entities:
class Article
{
/** @var ArrayCollection
protected $tags;
}
class Tag
{
protected $id;
protected $name;
}
Basically I've read http://symfony.com/doc/master/cookbook/form/form_collections.html but it does not explain my case.
Let me explain.
I've existing tags in database, so I want to be able to associate multiple Tags to my Article, I don't want to allow the creation of inexistent tags.
Since I'm aiming to use my form in both a REST api and with a web form, I'd like my client be able to use the id only to reference the tags (which would have been fetched before).
Any ideas?