mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-08-29 08:17:18 +08:00
git-subtree-dir: public/legacy git-subtree-split: 817a12dc0c30c189f56d5cb1f7dc37a9631bdbe3
21 lines
579 B
PHP
21 lines
579 B
PHP
<?php
|
|
namespace Api\V8\Param\Options;
|
|
|
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
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')
|
|
]));
|
|
}
|
|
}
|