|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?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\Container\PointSale\PointSaleContainer;
- use Lc\CaracoleBundle\Controller\AdminControllerTrait;
- use Lc\CaracoleBundle\Factory\PointSale\PointSaleFactory;
- use Lc\CaracoleBundle\Field\Address\AddressField;
- use Lc\CaracoleBundle\Resolver\MerchantResolver;
- 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)
- {
- return $this->get(PointSaleContainer::class)
- ->getFactory()
- ->create($this->get(MerchantResolver::class)->getCurrent());
- }
- }
|