$this->
dispatchValidationEvent($validation,
$data,
$context->
getContext());
$this->validator->
validate($data->
all(),
$validation);
$customerData =
$data->
only('firstName', 'lastName', 'salutationId', 'title', 'company', 'accountType'
);
if ($vatIds) { $customerData['vatIds'
] =
$data->
get('vatIds'
);
} if ($birthday =
$this->
getBirthday($data)) { $customerData['birthday'
] =
$birthday;
} if ($data->
get('customFields'
) instanceof RequestDataBag
) { $customerData['customFields'
] =
$this->storeApiCustomFieldMapper->
map( CustomerDefinition::ENTITY_NAME,
$data->
get('customFields'
) );
} $mappingEvent =
new DataMappingEvent($data,
$customerData,
$context->
getContext());