You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.9KB

  1. <?php
  2. namespace Lc\ShopBundle\Form\Backend\Order;
  3. use Doctrine\ORM\EntityManagerInterface;
  4. use Lc\ShopBundle\Context\OrderPaymentInterface;
  5. use Lc\ShopBundle\Context\OrderShopInterface;
  6. use Lc\ShopBundle\Model\OrderPayment;
  7. use Lc\ShopBundle\Services\Utils;
  8. use Symfony\Component\Form\AbstractType;
  9. use Symfony\Component\Form\Extension\Core\Type\ButtonType;
  10. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  11. use Symfony\Component\Form\Extension\Core\Type\DateType;
  12. use Symfony\Component\Form\Extension\Core\Type\HiddenType;
  13. use Symfony\Component\Form\Extension\Core\Type\MoneyType;
  14. use Symfony\Component\Form\Extension\Core\Type\NumberType;
  15. use Symfony\Component\Form\Extension\Core\Type\TextareaType;
  16. use Symfony\Component\Form\Extension\Core\Type\TextType;
  17. use Symfony\Component\Form\FormBuilderInterface;
  18. use Symfony\Component\OptionsResolver\OptionsResolver;
  19. class OrderSendPaymentLink extends AbstractType
  20. {
  21. protected $em;
  22. public function __construct(EntityManagerInterface $em)
  23. {
  24. $this->em = $em;
  25. }
  26. public function buildForm(FormBuilderInterface $builder, array $options)
  27. {
  28. $builder
  29. ->add('message', TextareaType::class, array(
  30. 'mapped'=>false
  31. ))
  32. ->add('send', ButtonType::class, array(
  33. 'label' => 'action.send'
  34. ))
  35. ->add('goto', ButtonType::class, array(
  36. 'label' => 'action.goto'
  37. ));
  38. }
  39. public function configureOptions(OptionsResolver $resolver)
  40. {
  41. $resolver->setDefaults([
  42. 'data_class' => $this->em->getClassMetadata(OrderShopInterface::class)->getName(),
  43. 'translation_domain' => 'lcshop'
  44. ]);
  45. }
  46. }