|
|
@@ -19,16 +19,16 @@ abstract class ProductFamilyAdminController extends AbstractAdminController |
|
|
|
{ |
|
|
|
$crud = parent::configureCrud($crud); |
|
|
|
|
|
|
|
if($this->getRequestCrudAction() === ActionDefinition::SORT) { |
|
|
|
if ($this->getRequestCrudAction() === ActionDefinition::SORT) { |
|
|
|
$crud->setDefaultSort(['position' => 'ASC']); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
$crud->setDefaultSort(['id' => 'DESC']); |
|
|
|
} |
|
|
|
|
|
|
|
return $crud; |
|
|
|
} |
|
|
|
|
|
|
|
public function getRepositoryQuery() :RepositoryQueryInterface |
|
|
|
public function getRepositoryQuery(): RepositoryQueryInterface |
|
|
|
{ |
|
|
|
return $this->get(ProductFamilyContainer::class)->getRepositoryQuery(); |
|
|
|
} |
|
|
@@ -36,8 +36,8 @@ abstract class ProductFamilyAdminController extends AbstractAdminController |
|
|
|
public function createEntity(string $entityFqcn) |
|
|
|
{ |
|
|
|
return $this->getProductFamilyContainer() |
|
|
|
->getFactory() |
|
|
|
->create($this->getMerchantCurrent()); |
|
|
|
->getFactory() |
|
|
|
->create($this->getMerchantCurrent()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@@ -45,6 +45,22 @@ abstract class ProductFamilyAdminController extends AbstractAdminController |
|
|
|
{ |
|
|
|
$responseParameters = parent::configureResponseParameters($responseParameters); |
|
|
|
|
|
|
|
$productFamiliesDto = []; |
|
|
|
$productFamilies = []; |
|
|
|
if ($responseParameters->get('entities')) { |
|
|
|
$productFamiliesDto = $responseParameters->get('entities'); |
|
|
|
} elseif ($responseParameters->get('entity')) { |
|
|
|
$productFamiliesDto = [$responseParameters->get('entity')]; |
|
|
|
} |
|
|
|
|
|
|
|
foreach ($productFamiliesDto as $productFamilyDto) { |
|
|
|
$productFamilies[] = $productFamilyDto->getInstance(); |
|
|
|
} |
|
|
|
|
|
|
|
$this->getProductFamilyContainer()->getStore() |
|
|
|
->setSection($this->getSectionCurrentDefault()) |
|
|
|
->getWithReductions($productFamilies); |
|
|
|
|
|
|
|
// affichage du filtre sur section |
|
|
|
$responseParameters->set('display_switch_section', true); |
|
|
|
|