Pārlūkot izejas kodu

Correctif

packProduct
Fabien Normand pirms 3 gadiem
vecāks
revīzija
e0fd05a63d
1 mainītis faili ar 6 papildinājumiem un 1 dzēšanām
  1. +6
    -1
      Controller/Product/ProductFamilyAdminController.php

+ 6
- 1
Controller/Product/ProductFamilyAdminController.php Parādīt failu

@@ -8,6 +8,7 @@ use EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext;
use Lc\CaracoleBundle\Container\Order\OrderShopContainer;
use Lc\CaracoleBundle\Container\Product\ProductFamilyContainer;
use Lc\CaracoleBundle\Controller\AbstractAdminController;
use Lc\CaracoleBundle\Definition\ActionDefinition;
use Lc\CaracoleBundle\Resolver\SectionResolver;
use Lc\SovBundle\Repository\RepositoryQueryInterface;
use Symfony\Component\HttpFoundation\Response;
@@ -18,7 +19,11 @@ abstract class ProductFamilyAdminController extends AbstractAdminController
{
$crud = parent::configureCrud($crud);

$crud->setDefaultSort(['id' => 'DESC']);
if($this->getRequestCrudAction() === ActionDefinition::SORT) {
$crud->setDefaultSort(['position' => 'DESC']);
}else{
$crud->setDefaultSort(['id' => 'DESC']);
}

return $crud;
}

Notiek ielāde…
Atcelt
Saglabāt