Ver código fonte

Fix

packProduct
Guillaume 3 anos atrás
pai
commit
3429fb185f
2 arquivos alterados com 13 adições e 1 exclusões
  1. +1
    -1
      Controller/Site/PageAdminController.php
  2. +12
    -0
      Field/AssociationField.php

+ 1
- 1
Controller/Site/PageAdminController.php Ver arquivo

@@ -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 Ver arquivo

@@ -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']);
}

Carregando…
Cancelar
Salvar