0
0
mirror of https://github.com/salesagility/SuiteCRM.git synced 2024-11-24 00:29:35 +00:00
salesagility_SuiteCRM/Api/V8/Param/Options/Id.php
2023-07-18 15:53:08 +01:00

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')
]));
}
}