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