$payloads =
$event->
getPayloads();
foreach ($payloads as $payload) { if (\
array_key_exists('salutationId',
$payload) &&
$payload['salutationId'
]) { continue;
} if (!
isset($payload['id'
])) { continue;
} $this->
updateNewsletterRecipientWithNotSpecifiedSalutation($payload['id'
]);
} } private function updateNewsletterRecipientWithNotSpecifiedSalutation(string
$id): void
{ $this->connection->
executeStatement( '
UPDATE `newsletter_recipient`
SET `salutation_id` = (
SELECT `id`
FROM `salutation`
WHERE `salutation_key` = :notSpecified
LIMIT 1
)
WHERE `id` = :id AND `salutation_id` is NULL
',