No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

UnitAdminController.php 1.1KB

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