|
|
|
|
|
|
|
|
namespace Lc\ShopBundle\Twig; |
|
|
namespace Lc\ShopBundle\Twig; |
|
|
|
|
|
|
|
|
use Doctrine\ORM\EntityManagerInterface; |
|
|
use Doctrine\ORM\EntityManagerInterface; |
|
|
|
|
|
use Lc\ShopBundle\Context\ProductInterface; |
|
|
use Lc\ShopBundle\Context\ReductionCartInterface; |
|
|
use Lc\ShopBundle\Context\ReductionCartInterface; |
|
|
use Lc\ShopBundle\Context\TicketInterface; |
|
|
use Lc\ShopBundle\Context\TicketInterface; |
|
|
|
|
|
use Lc\ShopBundle\Repository\ProductRepository; |
|
|
use Symfony\Contracts\Translation\TranslatorInterface; |
|
|
use Symfony\Contracts\Translation\TranslatorInterface; |
|
|
use Twig\Extension\AbstractExtension; |
|
|
use Twig\Extension\AbstractExtension; |
|
|
use Twig\TwigFilter; |
|
|
use Twig\TwigFilter; |
|
|
|
|
|
|
|
|
case 'ticket' : |
|
|
case 'ticket' : |
|
|
$ticketRepo = $this->em->getRepository(TicketInterface::class); |
|
|
$ticketRepo = $this->em->getRepository(TicketInterface::class); |
|
|
return $ticketRepo->countAllOpen(); |
|
|
return $ticketRepo->countAllOpen(); |
|
|
|
|
|
case 'productAvailabilitiesNegative' : |
|
|
|
|
|
$productRepo = $this->em->getRepository(ProductInterface::class); |
|
|
|
|
|
return count($productRepo->findProductByAvailabilitiesNegative()); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |