CodeExplorer EsdSerial example
foreach ($data['esd'
]['serials'
] as $newSerial) { $found = false;
foreach ($esd->
getSerials() as $serial) { if ($newSerial['serialnumber'
] ===
$serial->
getSerialnumber()) { $found = true;
break;
} } if ($found === false
) { $newSerialModel =
new EsdSerial();
$newSerialModel->
fromArray($newSerial);
$newSerialModel->
setEsd($esd);
$this->
getManager()->
persist($newSerialModel);
$esd->
getSerials()->
add($newSerialModel);
} } unset($data['esd'
]['serials'
]);
return $data;
}}