I have this script for inserting the data:
echo "Update ";
$department = new Department();
$department->setNamedepartment($data ['nameDepartment']);
$department->setCodedepartment($data ['codeDepartment']);
$department->setIdfkgeographicalarea($data ['idFkGeographicalArea']);
$entityManager->persist($department);
$entityManager->flush();
how can I update my $department
entity with only this call: update($data,$id)
?