Answer the question
In order to leave comments, you need to log in
Why is Symfony2 Form calling remove* along with add* ?
The entity has a posts property.
If you make a setter
setPosts($posts)
{
//...
}
addPosts($posts)
{
//...
}
Answer the question
In order to leave comments, you need to log in
When we talk about add and remove, we mean working with the ManyToMany relation, for example, i.e. with ArrayCollections.
Those. if your entity has a post s property that is a ManyToMany or OneToMany to a Post entity, then Symfony will look for addPost(Post $post) and removePost(Post $post).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question