|
- <?php
-
- namespace Lc\CaracoleBundle\Controller\Config;
-
- use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
- use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
- use Lc\CaracoleBundle\Container\Config\TaxRateContainer;
- use Lc\CaracoleBundle\Controller\AdminControllerTrait;
- use Lc\CaracoleBundle\Factory\Config\TaxRateFactory;
- use Lc\SovBundle\Controller\AbstractAdminController;
- use Lc\SovBundle\Repository\RepositoryQueryInterface;
-
- abstract class TaxRateAdminController extends AbstractAdminController
- {
- use AdminControllerTrait;
-
- public function getRepositoryQuery() :RepositoryQueryInterface
- {
- return $this->get(TaxRateContainer::class)->getRepositoryQuery();
- }
-
- public function configureFields(string $pageName): iterable
- {
- return [
- TextField::new('title'),
- NumberField::new('value')
- ];
- }
-
- public function configureCrud(Crud $crud): Crud
- {
- return $crud->setSearchFields(['id', 'title', 'value']);
- }
-
- public function createEntity(string $entityFqcn)
- {
- return $this->get(TaxRateContainer::class)->getFactory()->create();
- }
- }
|