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.

PointSaleAdminController.php 1.9KB

3 vuotta sitten
3 vuotta sitten
3 vuotta sitten
3 vuotta sitten
3 vuotta sitten
3 vuotta sitten
3 vuotta sitten
3 vuotta sitten
3 vuotta sitten
3 vuotta sitten
3 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace Lc\CaracoleBundle\Controller\PointSale;
  3. use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
  4. use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
  5. use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
  6. use Lc\CaracoleBundle\Controller\AdminControllerTrait;
  7. use Lc\CaracoleBundle\Factory\PointSale\PointSaleFactory;
  8. use Lc\CaracoleBundle\Field\Address\AddressField;
  9. use Lc\SovBundle\Controller\AbstractAdminController;
  10. use Lc\SovBundle\Field\BooleanField;
  11. use Lc\SovBundle\Field\StatusField;
  12. abstract class PointSaleAdminController extends AbstractAdminController
  13. {
  14. use AdminControllerTrait;
  15. public function configureFields(string $pageName): iterable
  16. {
  17. return array_merge(
  18. [
  19. FormField::addPanel('general'),
  20. TextField::new('title'),
  21. NumberField::new('orderAmountMin')
  22. ->setCustomOption('appendHtml','€')
  23. ->hideOnIndex(),
  24. NumberField::new('deliveryPrice')
  25. ->setCustomOption('appendHtml','€')
  26. ->hideOnIndex(),
  27. BooleanField::new('isPublic'),
  28. BooleanField::new('isDepository'),
  29. StatusField::new('status')
  30. ->hideOnIndex(),
  31. FormField::addPanel('address'),
  32. AddressField::new('address')
  33. ->setRequired(true)
  34. ],
  35. $this->getSeoPanel(),
  36. $this->getConfPanel(),
  37. );
  38. }
  39. public function createEntity(string $entityFqcn)
  40. {
  41. $factory = new PointSaleFactory();
  42. $currentMerchant = $this->get('merchant_resolver')->getCurrent();
  43. return $factory->create($currentMerchant);
  44. }
  45. }