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.

38 lines
1.3KB

  1. <?php
  2. namespace Lc\CaracoleBundle\Controller\Product;
  3. use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
  4. use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
  5. use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField;
  6. use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
  7. use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
  8. use EasyCorp\Bundle\EasyAdminBundle\Field\DateTimeField;
  9. use Lc\CaracoleBundle\Controller\AbstractAdminController;
  10. use Lc\SovBundle\Field\CKEditorField;
  11. use Lc\SovBundle\Field\StatusField;
  12. use Lc\SovBundle\Field\ToggleField;
  13. use Lc\SovBundle\Repository\RepositoryQueryInterface;
  14. abstract class ProductCategoryAdminController extends AbstractAdminController
  15. {
  16. public function getRepositoryQuery() :RepositoryQueryInterface
  17. {
  18. return $this->getProductCategoryContainer()->getRepositoryQuery();
  19. }
  20. public function createEntity(string $entityFqcn)
  21. {
  22. return $this->getProductCategoryContainer()->getFactory()->create($this->getSectionCurrent());
  23. }
  24. public function configureFields(string $pageName): iterable
  25. {
  26. return $this->getProductCategoryContainer()->getFieldDefinition()
  27. ->setMerchant($this->getMerchantCurrent())
  28. ->setSection($this->getSectionCurrent())
  29. ->getFields($pageName);
  30. }
  31. }