|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
-
- namespace Lc\CaracoleBundle\Controller\Product;
-
- use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\DateTimeField;
- use Lc\CaracoleBundle\Container\Product\ProductCategoryContainer;
- use Lc\CaracoleBundle\Controller\AdminControllerTrait;
- use Lc\SovBundle\Controller\AbstractAdminController;
- use Lc\SovBundle\Field\CKEditorField;
- use Lc\SovBundle\Field\StatusField;
- use Lc\SovBundle\Field\ToggleField;
- use Lc\SovBundle\Repository\RepositoryQueryInterface;
-
- abstract class ProductCategoryAdminController extends AbstractAdminController
- {
- use AdminControllerTrait;
-
- public function getRepositoryQuery() :RepositoryQueryInterface
- {
- return $this->get(ProductCategoryContainer::class)->getRepositoryQuery();
- }
-
- public function configureFields(string $pageName): iterable
- {
- return array_merge(
- [
- FormField::addPanel('general'),
- IntegerField::new('id')->onlyOnIndex()->setSortable(true),
- TextField::new('title')->setSortable(true),
- NumberField::new('position')->hideOnForm()->setSortable(true),
- AssociationField::new('parent')->hideOnIndex(),
- DateTimeField::new('createdAt')->setFormat('short')->setSortable(true),
- CKEditorField::new('description')->hideOnIndex(),
- StatusField::new('status')->setSortable(true),
- ToggleField::new('saleStatus')->setSortable(true),
- ToggleField::new('isEligibleTicketRestaurant')->setSortable(true),
-
- ],
- $this->getSeoPanel(),
- $this->getConfPanel()
- );
- }
-
- }
|