Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

56 linhas
2.9KB

  1. <?php
  2. namespace Lc\CaracoleBundle\Definition\Field\Order;
  3. use EasyCorp\Bundle\EasyAdminBundle\Field\DateTimeField;
  4. use EasyCorp\Bundle\EasyAdminBundle\Field\Field;
  5. use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField;
  6. use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
  7. use EasyCorp\Bundle\EasyAdminBundle\Field\TextareaField;
  8. use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
  9. use Lc\CaracoleBundle\Context\MerchantContextTrait;
  10. use Lc\CaracoleBundle\Field\AssociationField;
  11. use Lc\SovBundle\Definition\Field\AbstractFieldDefinition;
  12. class OrderShopFieldDefinition extends AbstractFieldDefinition
  13. {
  14. use MerchantContextTrait;
  15. public function configurePanels(): array
  16. {
  17. return [];
  18. }
  19. public function configureFields(): array
  20. {
  21. return [
  22. 'id' => IntegerField::new('id', 'ID')->setSortable(true),
  23. 'userLastname' => TextareaField::new('user.lastname', 'field.default.lastname')->setSortable(true),
  24. //->setTemplatePath('@LcShop/backend/default/field/textorempty.html.twig'),
  25. 'userFirstname' => TextareaField::new('user.firstname', 'field.default.firstname')->setSortable(true),
  26. //->setTemplatePath('@LcShop/backend/default/field/textorempty.html.twig'),
  27. 'userEmail' => TextareaField::new('user.email', 'field.default.email')->setSortable(true),
  28. //->setTemplatePath('@LcShop/backend/default/field/user.html.twig'),
  29. 'total' => NumberField::new('total')
  30. ->setTemplatePath('@LcCaracole/admin/order/field/total.html.twig'),
  31. 'orderStatus' => AssociationField::new('orderStatus')->setSortable(true)
  32. ->setTemplatePath('@LcCaracole/admin/order/field/order_status.html.twig'),
  33. 'createdAt' => DateTimeField::new('createdAt')->setSortable(true),
  34. 'updatedAt' => DateTimeField::new('updatedAt')->setSortable(true),
  35. 'orderShopCreatedAt' => DateTimeField::new('orderShopCreatedAt')->setSortable(true),
  36. 'cycleNumber' => IntegerField::new('cycleNumber')->setSortable(true),
  37. 'cycleDeliveryId' => IntegerField::new('cycleDeliveryId')->setSortable(true),
  38. 'cycleId' => IntegerField::new('cycleId')->setSortable(true),
  39. 'deliveryType' => Field::new('deliveryType')->setSortable(true),
  40. //->setTemplatePath('@LcShop/backend/default/field/options_translatable.html.twig'),
  41. 'reference' => TextField::new('reference')->setSortable(true),
  42. 'complementaryOrderShops' => AssociationField::new('complementaryOrderShops')->setFormTypeOption('mapped', false)
  43. ->setTemplatePath('@LcCaracole/admin/order/field/complementary.html.twig'),
  44. 'orderPayments' => AssociationField::new('orderPayments')
  45. ->setTemplatePath('@LcCaracole/admin/order/field/order_payment.html.twig'),
  46. 'user'=> AssociationField::new('user')->setSortable(true)
  47. ];
  48. }
  49. }