|
|
@@ -3,8 +3,10 @@ |
|
|
|
namespace Lc\ShopBundle\Twig; |
|
|
|
|
|
|
|
use Doctrine\ORM\EntityManagerInterface; |
|
|
|
use Lc\ShopBundle\Context\ProductInterface; |
|
|
|
use Lc\ShopBundle\Context\ReductionCartInterface; |
|
|
|
use Lc\ShopBundle\Context\TicketInterface; |
|
|
|
use Lc\ShopBundle\Repository\ProductRepository; |
|
|
|
use Symfony\Contracts\Translation\TranslatorInterface; |
|
|
|
use Twig\Extension\AbstractExtension; |
|
|
|
use Twig\TwigFilter; |
|
|
@@ -83,6 +85,9 @@ class BackendTwigExtension extends AbstractExtension |
|
|
|
case 'ticket' : |
|
|
|
$ticketRepo = $this->em->getRepository(TicketInterface::class); |
|
|
|
return $ticketRepo->countAllOpen(); |
|
|
|
case 'productAvailabilitiesNegative' : |
|
|
|
$productRepo = $this->em->getRepository(ProductInterface::class); |
|
|
|
return count($productRepo->findProductByAvailabilitiesNegative()); |
|
|
|
|
|
|
|
} |
|
|
|
} |