protected buildBoolType ( Symfony\Component\Form\FormBuilderInterface $builder, array $options, string $fieldName, Dumplie\Metadata\Schema\FieldDefinition $definition ) | ||
$builder | Symfony\Component\Form\FormBuilderInterface | |
$options | array | |
$fieldName | string | |
$definition | Dumplie\Metadata\Schema\FieldDefinition |
protected function buildBoolType(FormBuilderInterface $builder, array $options, string $fieldName, FieldDefinition $definition)
{
$typeOptions = $options['type_options'];
$typeForms = $options['type_forms'];
$builder->add($fieldName, array_key_exists($fieldName, $typeForms) ? $typeForms[$fieldName] : CheckboxType::class, array_key_exists($fieldName, $typeOptions) ? $typeOptions[$fieldName] : []);
}