more tentative to correct AccPeriodWorkEvaluationDenormalizer

This commit is contained in:
nobohan 2022-02-25 15:06:16 +01:00
parent 2ea5c4b0c7
commit 2cc7473276

View File

@ -92,10 +92,12 @@ class AccompanyingPeriodWorkEvaluationDenormalizer implements ContextAwareDenorm
->partition( ->partition(
static fn (int $key, AccompanyingPeriodWorkEvaluationDocument $a) => array_key_exists($a->getId(), $dataById) static fn (int $key, AccompanyingPeriodWorkEvaluationDocument $a) => array_key_exists($a->getId(), $dataById)
); );
$kept = $evaluation->getDocuments(); //$kept = $evaluation->getDocuments();
dump($kept); dump($kept);
dump($removed);
// remove the document from evaluation // remove the document from evaluation
foreach ($removed as $r) { foreach ($removed as $r) {
dump($r);
$evaluation->removeDocument($r); $evaluation->removeDocument($r);
} }
// handle the documents kept // handle the documents kept
@ -120,6 +122,7 @@ class AccompanyingPeriodWorkEvaluationDenormalizer implements ContextAwareDenorm
} }
// create new document // create new document
foreach ($dataWithoutId as $newData) { foreach ($dataWithoutId as $newData) {
dump($newData);
$document = $this->denormalizer->denormalize( $document = $this->denormalizer->denormalize(
$newData, $newData,
AccompanyingPeriodWorkEvaluationDocument::class, AccompanyingPeriodWorkEvaluationDocument::class,