Quellcode durchsuchen

Refactoring controller

feature/ticket
Fab vor 3 Jahren
Ursprung
Commit
9a515f417d
2 geänderte Dateien mit 5 neuen und 28 gelöschten Zeilen
  1. +5
    -16
      Controller/AdminControllerTrait.php
  2. +0
    -12
      Controller/User/UserMerchantAdminController.php

Controller/AbstractAdminController.php → Controller/AdminControllerTrait.php Datei anzeigen

@@ -2,40 +2,29 @@

namespace Lc\CaracoleBundle\Controller;

use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\QueryBuilder;
use EasyCorp\Bundle\EasyAdminBundle\Collection\FieldCollection;
use EasyCorp\Bundle\EasyAdminBundle\Collection\FilterCollection;

use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface;
use Lc\CaracoleBundle\Factory\User\UserMerchantFactory;
use Lc\CaracoleBundle\Resolver\MerchantResolver;
use Lc\CaracoleBundle\Resolver\SectionResolver;
use Lc\SovBundle\Controller\AbstractAdminController as SovAbstractAdminController;
use EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto;
use EasyCorp\Bundle\EasyAdminBundle\Dto\SearchDto;
use Lc\SovBundle\Doctrine\EntityManager;
use Lc\SovBundle\Doctrine\Extension\TreeInterface;
use Lc\SovBundle\Translation\TranslatorAdmin;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Lc\SovBundle\Factory\User\UserFactory;


//TODO ce fichier ne devrait plus exister
abstract class AbstractAdminController extends SovAbstractAdminController
trait AdminControllerTrait
{
protected $session;
protected $request;
protected $merchantResolver;
protected $sectionResolver;


public static function getSubscribedServices()
{
return array_merge(parent::getSubscribedServices(), [
'merchant_resolver' => MerchantResolver::class,
'section_resolver' => SectionResolver::class,

'user_factory' => UserFactory::class,
'user_merchant_factory' => UserMerchantFactory::class,
]);
}
public function createIndexQueryBuilder(

+ 0
- 12
Controller/User/UserMerchantAdminController.php Datei anzeigen

@@ -20,18 +20,6 @@ use Symfony\Component\HttpFoundation\Response;
abstract class UserMerchantAdminController extends AbstractAdminController
{

public static function getSubscribedServices()
{
return array_merge(parent::getSubscribedServices(), [
'user_factory' => UserFactory::class,
'user_merchant_factory' => UserMerchantFactory::class,
'merchant_resolver' => MerchantResolver::class,
'section_resolver' => SectionResolver::class,

]);
}


public function configureFields(string $pageName): iterable
{
return [

Laden…
Abbrechen
Speichern