0
0
mirror of https://github.com/salesagility/SuiteCRM.git synced 2024-12-28 14:58:08 +00:00
salesagility_SuiteCRM/Api/V8/Param/UpdateModuleParams.php
2023-07-18 15:53:08 +01:00

39 lines
1.1 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 UpdateModuleParams extends BaseParam
{
/**
* @return CreateModuleDataParams
*/
public function getData()
{
return $this->parameters['data'];
}
/**
* @inheritdoc
*/
protected function configureParameters(OptionsResolver $resolver)
{
// need to make this more simple
$resolver
->setRequired('data')
->setAllowedTypes('data', 'array')
->setAllowedValues('data', $this->validatorFactory->createClosureForIterator([
new Assert\NotBlank(),
]))
->setNormalizer('data', function (Options $options, $values) {
$dataParams = new UpdateModuleDataParams($this->validatorFactory, $this->beanManager);
$dataParams->configure($values);
return $dataParams;
});
}
}