Reputation: 57
I'm trying to update an entity. I have a form, who returns an array to my formHandler.
There is my onSuccess()
public function onSuccess($createIndicatorModelFormModel)
{
$this->em->persist($this->indicatorModelTransformer->transform($createIndicatorModelFormModel));
$this->em->flush();
}
I can't persist an array, that's why i've made an transformer.
The problem is when i'm trying to persist or merge. He is trying to INSERT an new row.. What can i do ?
Upvotes: 1
Views: 48
Reputation: 1289
You have to call method persist() when initializing a new object. Use it without persisting it when updating. To resolve this issue i need more code. Or my guess based on your question is to simply commenting out the persist part.
Upvotes: 1