if (!
empty($dataBag->
get('lastName'
))) { $definition->
add('lastName',
new NotBlank(),
new Regex([ 'pattern' => self::DOMAIN_NAME_REGEX,
'match' => false,
]));
} if ($validateStorefrontUrl) { $definition ->
add('storefrontUrl',
new NotBlank(),
new Choice(array_values($this->
getDomainUrls($context))));
} $validationEvent =
new BuildValidationEvent($definition,
$dataBag,
$context->
getContext());
$this->eventDispatcher->
dispatch($validationEvent,
$validationEvent->
getName());
return $definition;
} /**
* @param SubscribeRequest $data
*
* @return array{id: string, languageId: string, salesChannelId: string, status: string, hash: string, email: string, storefrontUrl: string, firstName?: string, lastName?: string, zipCode?: string, city?: string, street?: string, salutationId?: string}
*/