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.

ProductCategoryAdminController.php 1.9KB

pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
pirms 3 gadiem
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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\Container\Product\ProductCategoryContainer;
  10. use Lc\CaracoleBundle\Controller\AdminControllerTrait;
  11. use Lc\SovBundle\Controller\AbstractAdminController;
  12. use Lc\SovBundle\Field\CKEditorField;
  13. use Lc\SovBundle\Field\StatusField;
  14. use Lc\SovBundle\Field\ToggleField;
  15. use Lc\SovBundle\Repository\RepositoryQueryInterface;
  16. abstract class ProductCategoryAdminController extends AbstractAdminController
  17. {
  18. use AdminControllerTrait;
  19. public function getRepositoryQuery() :RepositoryQueryInterface
  20. {
  21. return $this->get(ProductCategoryContainer::class)->getRepositoryQuery();
  22. }
  23. public function configureFields(string $pageName): iterable
  24. {
  25. return array_merge(
  26. [
  27. FormField::addPanel('general'),
  28. IntegerField::new('id')->onlyOnIndex()->setSortable(true),
  29. TextField::new('title')->setSortable(true),
  30. NumberField::new('position')->hideOnForm()->setSortable(true),
  31. AssociationField::new('parent')->hideOnIndex(),
  32. DateTimeField::new('createdAt')->setFormat('short')->setSortable(true),
  33. CKEditorField::new('description')->hideOnIndex(),
  34. StatusField::new('status')->setSortable(true),
  35. ToggleField::new('saleStatus')->setSortable(true),
  36. ToggleField::new('isEligibleTicketRestaurant')->setSortable(true),
  37. ],
  38. $this->getSeoPanel(),
  39. $this->getConfPanel()
  40. );
  41. }
  42. }