瀏覽代碼

OpeningStore : section optionnal

packProduct
Guillaume 3 年之前
父節點
當前提交
b7486797e1
共有 2 個檔案被更改,包括 1 行新增32 行删除
  1. +0
    -30
      EventSubscriber/OpeningEventSubscriber.php
  2. +1
    -2
      Repository/Section/OpeningStore.php

+ 0
- 30
EventSubscriber/OpeningEventSubscriber.php 查看文件

@@ -1,30 +0,0 @@
<?php

namespace Lc\CaracoleBundle\EventSubscriber;

use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\KernelEvents;

class OpeningEventSubscriber implements EventSubscriberInterface
{
protected EntityManagerInterface $entityManager;

public function __construct(
EntityManagerInterface $entityManager
) {
$this->entityManager = $entityManager;
}

public static function getSubscribedEvents()
{
return [
KernelEvents::CONTROLLER => ['initOpenings']
];
}

public function initOpenings()
{
}

}

+ 1
- 2
Repository/Section/OpeningStore.php 查看文件

@@ -25,7 +25,7 @@ class OpeningStore extends AbstractStore

public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
{
$query->filterBySection($this->section);
$this->addFilterBySectionOptionnal($query);
return $query;
}

@@ -33,5 +33,4 @@ class OpeningStore extends AbstractStore
{
return $query;
}

}

Loading…
取消
儲存