Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

36 rindas
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\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. }