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

38 lines
1.0 KiB
PHP

<?php
namespace Api\V8\Param;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints as Assert;
#[\AllowDynamicProperties]
class CreateModuleParams extends BaseParam
{
/**
* @return CreateModuleDataParams
*/
public function getData()
{
return $this->parameters['data'];
}
/**
* @inheritdoc
*/
protected function configureParameters(OptionsResolver $resolver)
{
$resolver
->setRequired('data')
->setAllowedTypes('data', 'array')
->setAllowedValues('data', $this->validatorFactory->createClosureForIterator([
new Assert\NotBlank(),
]))
->setNormalizer('data', function (Options $options, $values) {
$dataParams = new CreateModuleDataParams($this->validatorFactory, $this->beanManager);
$dataParams->configure($values);
return $dataParams;
});
}
}