You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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\Container\Config\UnitContainer;
  9. use Lc\CaracoleBundle\Controller\AdminControllerTrait;
  10. use Lc\CaracoleBundle\Factory\Config\UnitFactory;
  11. use Lc\SovBundle\Controller\AbstractAdminController;
  12. abstract class UnitAdminController extends AbstractAdminController
  13. {
  14. use AdminControllerTrait;
  15. public function configureFields(string $pageName): iterable
  16. {
  17. return [
  18. TextField::new('unit'),
  19. TextField::new('wording'),
  20. TextField::new('wordingUnit'),
  21. TextField::new('wordingShort'),
  22. IntegerField::new('coefficient'),
  23. AssociationField::new('unitReference'),
  24. ];
  25. }
  26. public function createEntity(string $entityFqcn)
  27. {
  28. return $this->get(UnitContainer::class)->getFactory()->create();
  29. }
  30. }