您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

36 行
1.1KB

  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. }