<?php
namespace Bidcoz\Bundle\FrontendBundle\Form\Type\Donation;
use RS\DiExtraBundle\Annotation as DI;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\MoneyType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Range;
/**
* @DI\FormType
*/
class CashType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('amount', MoneyType::class, [
'currency' => 'USD',
'constraints' => [
new NotBlank(),
new Range([
'min' => 0,
]),
],
])
;
}
public function getBlockPrefix()
{
return 'donate_cash';
}
}