I have a question about inserting multiple entities. What happens to the entities if i persist every entity in a loop and then i flush ? I mean what happens if one of this entities is duplicated and can't be inserted ? Are all entities removed or only the one which is duplicated ?
foreach($datas as $data) {
$obj = new DataLerne();
// Code ..
$obj->setAtt($data['att']);
$em->persist($obj);
}
$em->flush();
Thank you for your responses