|
1234567891011121314151617181920212223242526272829303132333435 |
- <?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\Controller\AdminControllerTrait;
- use Lc\CaracoleBundle\Factory\Config\UnitFactory;
- use Lc\SovBundle\Controller\AbstractAdminController;
-
- abstract class UnitAdminController extends AbstractAdminController
- {
- use AdminControllerTrait;
-
- 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'),
- ];
- }
-
- public function createEntity(string $entityFqcn)
- {
- $factory = new UnitFactory();
- return $factory->create();
- }
- }
|