mirror of
https://github.com/salesagility/SuiteCRM.git
synced 2024-12-28 23:08:09 +00:00
23 lines
606 B
PHP
23 lines
606 B
PHP
<?php
|
|
namespace Api\V8\Param\Options;
|
|
|
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
#[\AllowDynamicProperties]
|
|
class Id extends BaseOption
|
|
{
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
public function add(OptionsResolver $resolver)
|
|
{
|
|
$resolver
|
|
->setRequired('id')
|
|
->setAllowedTypes('id', 'string')
|
|
->setAllowedValues('id', $this->validatorFactory->createClosure([
|
|
new Assert\Regex('/^(\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i')
|
|
]));
|
|
}
|
|
}
|