|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
-
- namespace Lc\CaracoleBundle\Controller\Merchant;
-
- use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
- 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\Merchant\MerchantFactory;
- use Lc\CaracoleBundle\Field\Address\AddressField;
- use Lc\SovBundle\Controller\AbstractAdminController;
- use Lc\SovBundle\Field\CKEditorField;
- use Lc\SovBundle\Field\StatusField;
-
- abstract class MerchantAdminController extends AbstractAdminController
- {
- use AdminControllerTrait;
-
- public function configureFields(string $pageName): iterable
- {
- $panel = parent::configureFields($pageName);
-
- return array_merge(
- [
- FormField::addPanel('general'),
- TextField::new('title'),
- NumberField::new('position')
- ->hideOnForm()
- ->hideOnIndex(),
- CKEditorField::new('description')
- ->hideOnIndex(),
- AssociationField::new('taxRate')
- ->setRequired(true)
- ->hideOnIndex(),
- StatusField::new('status'),
-
- FormField::addPanel('address'),
- AddressField::new('address')
- ->setRequired(true),
- ],
- $panel
- );
- }
-
- public function createEntity(string $entityFqcn)
- {
- $factory = new MerchantFactory();
- return $factory->create();
- }
-
- }
|