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.

46 lines
1.5KB

  1. <?php
  2. namespace Lc\CaracoleBundle\Controller\Merchant;
  3. use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
  4. use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
  5. use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
  6. use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
  7. use Lc\CaracoleBundle\Controller\AdminControllerTrait;
  8. use Lc\CaracoleBundle\Field\Address\AddressField;
  9. use Lc\SovBundle\Controller\AbstractAdminController;
  10. use Lc\SovBundle\Field\CKEditorField;
  11. use Lc\SovBundle\Field\StatusField;
  12. abstract class MerchantAdminController extends AbstractAdminController
  13. {
  14. use AdminControllerTrait;
  15. public function configureFields(string $pageName): iterable
  16. {
  17. $panel = parent::configureFields($pageName);
  18. return array_merge(
  19. [
  20. FormField::addPanel('general'),
  21. TextField::new('title'),
  22. NumberField::new('position')
  23. ->hideOnForm()
  24. ->hideOnIndex(),
  25. CKEditorField::new('description')
  26. ->hideOnIndex(),
  27. AssociationField::new('taxRate')
  28. ->setRequired(true)
  29. ->hideOnIndex(),
  30. StatusField::new('status'),
  31. FormField::addPanel('address'),
  32. AddressField::new('address')
  33. ],
  34. $panel
  35. );
  36. }
  37. }