No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

62 líneas
3.0KB

  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 configureFieldsIndex(): array
  16. {
  17. return ['id'];
  18. }
  19. public function configurePanels(): array
  20. {
  21. return [];
  22. }
  23. public function configureFields(): array
  24. {
  25. return [
  26. 'id' => IntegerField::new('id', 'ID')->setSortable(true),
  27. 'userLastname' => TextareaField::new('user.lastname', 'field.default.lastname')->setSortable(true),
  28. //->setTemplatePath('@LcShop/backend/default/field/textorempty.html.twig'),
  29. 'userFirstname' => TextareaField::new('user.firstname', 'field.default.firstname')->setSortable(true),
  30. //->setTemplatePath('@LcShop/backend/default/field/textorempty.html.twig'),
  31. 'userEmail' => TextareaField::new('user.email', 'field.default.email')->setSortable(true),
  32. //->setTemplatePath('@LcShop/backend/default/field/user.html.twig'),
  33. 'total' => NumberField::new('total')
  34. ->setTemplatePath('@LcCaracole/admin/order/field/total.html.twig'),
  35. 'orderStatus' => AssociationField::new('orderStatus')->setSortable(true)
  36. ->setTemplatePath('@LcCaracole/admin/order/field/order_status.html.twig'),
  37. 'createdAt' => DateTimeField::new('createdAt')->setSortable(true),
  38. 'updatedAt' => DateTimeField::new('updatedAt')->setSortable(true),
  39. 'orderShopCreatedAt' => DateTimeField::new('orderShopCreatedAt')->setSortable(true),
  40. 'distribution' => AssociationField::new('distribution')->setSortable(true),
  41. 'cycleDeliveryId' => IntegerField::new('cycleDeliveryId')->setSortable(true),
  42. 'cycleId' => IntegerField::new('cycleId')->setSortable(true),
  43. 'deliveryType' => Field::new('deliveryType')->setSortable(true),
  44. //->setTemplatePath('@LcShop/backend/default/field/options_translatable.html.twig'),
  45. 'reference' => TextField::new('reference')->setSortable(true),
  46. 'complementaryOrderShops' => AssociationField::new('complementaryOrderShops')->setFormTypeOption('mapped', false)
  47. ->setTemplatePath('@LcCaracole/admin/order/field/complementary.html.twig'),
  48. 'orderPayments' => AssociationField::new('orderPayments')
  49. ->setTemplatePath('@LcCaracole/admin/order/field/order_payment.html.twig'),
  50. 'user'=> AssociationField::new('user')->setSortable(true)
  51. ];
  52. }
  53. }