1 | <?php |
||
32 | class ShoppingType extends AbstractType |
||
|
|||
33 | { |
||
34 | |||
35 | /** |
||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | 85 | public function buildForm(FormBuilderInterface $builder, array $options) |
|
39 | { |
||
40 | |||
41 | 85 | $payments = $options['payments']; |
|
42 | 85 | $payment = $options['payment']; |
|
43 | 85 | $message = $options['message']; |
|
44 | |||
45 | $builder |
||
46 | 85 | ->add('payment', 'entity', array( |
|
47 | 85 | 'class' => 'Eccube\Entity\Payment', |
|
48 | 85 | 'property' => 'method', |
|
49 | 85 | 'choices' => $payments, |
|
50 | 85 | 'data' => $payment, |
|
51 | 'expanded' => true, |
||
52 | 'constraints' => array( |
||
53 | 85 | new Assert\NotBlank(), |
|
54 | ), |
||
55 | )) |
||
56 | 85 | ->add('message', 'textarea', array( |
|
57 | 85 | 'required' => false, |
|
58 | 85 | 'data' => $message, |
|
59 | 'constraints' => array( |
||
60 | 85 | new Assert\Length(array('min' => 0, 'max' => 3000))), |
|
61 | )); |
||
62 | |||
63 | } |
||
64 | |||
65 | 85 | public function configureOptions(OptionsResolver $resolver) |
|
73 | |||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | 663 | public function getName() |
|
81 | } |
||
82 |