'doPostTransform', PostTransformEvent::class => 'doPreTransform' ]; } /** * Evénement se passant avant l'update d'un index ES * @param TransformEvent $event */ public function doPreTransform(TransformEvent $event): void { } /** * Evénement se passant après l'update d'un index ES * @param TransformEvent $event */ public function doPostTransform(TransformEvent $event): void { $document = $event->getDocument(); $object = $event->getObject(); if ($object instanceof EducationNotation) { $this->educationNotationTransform($document, $object); } } /** * Recalcul et met à jour les note d'une évaluation suivant la note maximal configurée par la structure * @param $document * @param $object */ private function educationNotationTransform(mixed $document, EducationNotation $educationNotation): void{ $document->set('note_origine', $this->educationNotationUtils->getNotationOriginal($educationNotation)); $document->set('note_recalcul', $this->educationNotationUtils->getNotationTransformed($educationNotation)); } }