|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?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\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
- {
- public function getRepositoryQuery() :RepositoryQueryInterface
- {
- return $this->getProductCategoryContainer()->getRepositoryQuery();
- }
-
- public function createEntity(string $entityFqcn)
- {
- return $this->getProductCategoryContainer()->getFactory()->create($this->getSectionCurrent());
- }
-
- 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()
- );
- }
-
- }
|