Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

TaxRateAdminController.php 1.2KB

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