Parcourir la source

AbstractAdminController

develop
Guillaume il y a 3 ans
Parent
révision
37555ef669
2 fichiers modifiés avec 16 ajouts et 1 suppressions
  1. +3
    -0
      Controller/AbstractAdminController.php
  2. +13
    -1
      Controller/ControllerTrait.php

+ 3
- 0
Controller/AbstractAdminController.php Voir le fichier

@@ -152,6 +152,9 @@ abstract class AbstractAdminController extends EaAbstractCrudController
if ($this->isInstanceOf(SortableInterface::class)) {
$crud->setDefaultSort(['position' => 'ASC']);
}
else {
$crud->setDefaultSort(['id' => 'DESC']);
}

return $crud;
}

+ 13
- 1
Controller/ControllerTrait.php Voir le fichier

@@ -22,6 +22,7 @@ use Lc\SovBundle\Repository\EntityRepository;
use Lc\SovBundle\Solver\Setting\SettingSolver;
use Lc\SovBundle\Translation\FlashBagTranslator;
use Lc\SovBundle\Translation\TranslatorAdmin;
use Mailjet\MailjetSwiftMailer\SwiftMailer\MailjetTransport;
use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -54,6 +55,8 @@ trait ControllerTrait
TranslatorAdmin::class => TranslatorAdmin::class,
FilterManager::class => FilterManager::class,
FlashBagTranslator::class => FlashBagTranslator::class,
MailjetTransport::class => MailjetTransport::class,
AdminUrlGenerator::class => AdminUrlGenerator::class,
SettingSolver::class => SettingSolver::class,
ComponentContainer::class => ComponentContainer::class,
FileContainer::class => FileContainer::class,
@@ -72,7 +75,6 @@ trait ControllerTrait
);
}


public function addFlashTranslator(
string $type,
$translationKeyName,
@@ -181,6 +183,16 @@ trait ControllerTrait
return $this->get(LoggerInterface::class);
}

public function getMailjetTransport(): MailjetTransport
{
return $this->get(MailjetTransport::class);
}

public function getAdminUrlGenerator(): AdminUrlGenerator
{
return $this->get(AdminUrlGenerator::class);
}

public function getSettingSolver(): SettingSolver
{
return $this->get(SettingSolver::class);

Chargement…
Annuler
Enregistrer