|
- <?php
-
- namespace Lc\CaracoleBundle\Controller\PointSale;
-
- use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
- use Lc\CaracoleBundle\Controller\AdminControllerTrait;
- use Lc\CaracoleBundle\Factory\PointSale\PointSaleFactory;
- use Lc\CaracoleBundle\Field\Address\AddressField;
- use Lc\SovBundle\Controller\AbstractAdminController;
- use Lc\SovBundle\Field\BooleanField;
- use Lc\SovBundle\Field\StatusField;
-
- abstract class PointSaleAdminController extends AbstractAdminController
- {
- use AdminControllerTrait;
-
- public function configureFields(string $pageName): iterable
- {
-
- return array_merge(
- [
- FormField::addPanel('general'),
- TextField::new('title'),
- NumberField::new('orderAmountMin')
- ->setCustomOption('appendHtml','€')
- ->hideOnIndex(),
- NumberField::new('deliveryPrice')
- ->setCustomOption('appendHtml','€')
- ->hideOnIndex(),
- BooleanField::new('isPublic'),
- BooleanField::new('isDepository'),
- StatusField::new('status')
- ->hideOnIndex(),
- FormField::addPanel('address'),
- AddressField::new('address')
- ->setRequired(true)
- ],
- $this->getSeoPanel(),
- $this->getConfPanel(),
- );
- }
-
- public function createEntity(string $entityFqcn)
- {
- $factory = new PointSaleFactory();
- $currentMerchant = $this->get('merchant_resolver')->getCurrent();
- return $factory->create($currentMerchant);
- }
- }
|