getMergedWriteResult example

public function mergeWriteResults(
        EntityWrittenEvent $writtenEvent,
        ?EntityWrittenEvent $translationEvent
    ): ?EntityWrittenEvent {
        if ($writtenEvent instanceof EntityDeletedEvent) {
            return $writtenEvent;
        }

        $mergedWriteResults = [];
        foreach ($writtenEvent->getWriteResults() as $writeResult) {
            if ($translationEvent) {
                $mergedWriteResults[] = $this->getMergedWriteResult($translationEvent$writeResult);

                continue;
            }

            if (empty($writeResult->getPayload())) {
                continue;
            }

            $mergedWriteResults[] = $writeResult;
        }

        
Home | Imprint | This part of the site doesn't use cookies.