On Symfony 3.3, doctrine 2.5 and PHP 5.5.9
My front is sending my API an array that looks like
[{id: 1, value: 2}, {id: 2, value: 2423}, {id: 56, value: 323.3}]
And I need to update my entity with all those values.
I've came across this
foreach ($repo->findById($ids) as $obj) {
$obj->setOrder(array_search($obj->getId(), $ids));
}
$em->flush();
But can't work my mind on own to make it work to update the values from my array.
What is the best way to update each values of the entities, using the inputted array ?