|
- <?php
-
- namespace Lc\CaracoleBundle\Controller\Config;
-
- use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
- use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
- use Lc\CaracoleBundle\Container\Config\UnitContainer;
- use Lc\CaracoleBundle\Controller\AdminControllerTrait;
- use Lc\CaracoleBundle\Factory\Config\UnitFactory;
- use Lc\SovBundle\Controller\AbstractAdminController;
- use Lc\SovBundle\Repository\RepositoryQueryInterface;
-
- abstract class UnitAdminController extends AbstractAdminController
- {
- use AdminControllerTrait;
- public function getRepositoryQuery() :RepositoryQueryInterface
- {
- return $this->get(UnitContainer::class)->getRepositoryQuery();
- }
-
- public function configureFields(string $pageName): iterable
- {
- return [
- TextField::new('unit'),
- TextField::new('wording'),
- TextField::new('wordingUnit'),
- TextField::new('wordingShort'),
- IntegerField::new('coefficient'),
- AssociationField::new('unitReference')
- ->setCustomOption('filter', false),
- ];
- }
-
- public function createEntity(string $entityFqcn)
- {
- return $this->get(UnitContainer::class)->getFactory()->create();
- }
- }
|