Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

36 lines
994B

  1. <?php
  2. namespace Lc\CaracoleBundle\Controller\Config;
  3. use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
  4. use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField;
  5. use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
  6. use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
  7. use Lc\CaracoleBundle\Controller\AdminControllerTrait;
  8. use Lc\CaracoleBundle\Factory\Config\TaxRateFactory;
  9. use Lc\SovBundle\Controller\AbstractAdminController;
  10. abstract class TaxRateAdminController extends AbstractAdminController
  11. {
  12. use AdminControllerTrait;
  13. public function configureFields(string $pageName): iterable
  14. {
  15. return [
  16. TextField::new('title'),
  17. NumberField::new('value')
  18. ];
  19. }
  20. public function configureCrud(Crud $crud): Crud
  21. {
  22. return $crud->setSearchFields(['id', 'title', 'value']);
  23. }
  24. public function createEntity(string $entityFqcn)
  25. {
  26. $factory = new TaxRateFactory();
  27. return $factory->create();
  28. }
  29. }