Przeglądaj źródła

Fix

packProduct
Guillaume 3 lat temu
rodzic
commit
3429fb185f
2 zmienionych plików z 13 dodań i 1 usunięć
  1. +1
    -1
      Controller/Site/PageAdminController.php
  2. +12
    -0
      Field/AssociationField.php

+ 1
- 1
Controller/Site/PageAdminController.php Wyświetl plik

@@ -14,7 +14,7 @@ abstract class PageAdminController extends SovPageAdminController

public function createEntity(string $entityFqcn)
{
return $this->get(PageContainer::class)
return $this->getPageContainer()
->getFactory()
->setSection($this->get(SectionResolver::class)->getCurrent())
->create();

+ 12
- 0
Field/AssociationField.php Wyświetl plik

@@ -71,6 +71,13 @@ final class AssociationField implements FieldInterface
return $this;
}

public function setFilterOnMerchantViaSection(MerchantInterface $merchant): self
{
$this->queryBuilderParameters['merchantViaSection'] = $merchant;

return $this;
}

public function setFilterOnDevAlias(string $devAlias): self
{
$this->queryBuilderParameters['devAlias'] = $devAlias;
@@ -129,6 +136,11 @@ final class AssociationField implements FieldInterface
$qb->andWhereMerchantManyToMany('e', $param['merchantManyToMany']);
}

if (isset($param['merchantViaSection'])) {
$qb->leftJoin('e.section', 's');
$qb->andWhereMerchant('s', $param['merchantViaSection']);
}

if (isset($param['status'])) {
$qb->andWhere('e.status = :status')->setParameter('status', $param['status']);
}

Ładowanie…
Anuluj
Zapisz