src/Bidcoz/Bundle/FrontendBundle/Controller/Auction/ShopController.php line 25

Open in your IDE?
  1. <?php
  2. namespace Bidcoz\Bundle\FrontendBundle\Controller\Auction;
  3. use Bidcoz\Bundle\CoreBundle\Controller\CoreController;
  4. use Bidcoz\Bundle\CoreBundle\Entity\Auction\Shop;
  5. use Bidcoz\Bundle\CoreBundle\Entity\Campaign;
  6. use Bidcoz\Bundle\CoreBundle\Entity\Organization;
  7. use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
  8. use Symfony\Component\HttpFoundation\Request;
  9. use Symfony\Component\Routing\Annotation\Route;
  10. /**
  11.  * @Route("/{orgSlug}/{campaignSlug}/shop")
  12.  * @IsGranted("VIEW", subject="organization")
  13.  * @IsGranted("FRONT_END", subject="campaign")
  14.  */
  15. class ShopController extends CoreController
  16. {
  17.     use ItemCatalogQueryTrait;
  18.     /**
  19.      * @Route("/list", name="shop_catalog")
  20.      */
  21.     public function catalogAction(Request $requestOrganization $organizationCampaign $campaignShop $shop)
  22.     {
  23.         $qb $this->getRepository('Auction\Item')->getAuctionQueryBuilder($shoptruefalse);
  24.         $filterForm $this->getItemFilterForm($shop);
  25.         $hasFilter  $this->applyFilters($request$filterForm$qb);
  26.         $orderForm $this->getItemOrderForm();
  27.         // No fixed-price exclusion on bid-count sorts here: a shop is almost
  28.         // entirely fixed-price, so applying the auction catalog's rule would
  29.         // empty it. This matches what this controller has always done.
  30.         $hasOrder $this->applyOrder($request$orderForm$qb);
  31.         $items $this->getPagination($qb);
  32.         return $this->render('@BidcozFrontend/Auction/catalog.html.twig', [
  33.             'type'         => 'shop',
  34.             'title'        => $campaign->getShopDisplayName().' Catalog',
  35.             'organization' => $organization,
  36.             'campaign'     => $campaign,
  37.             'auction'      => $shop,
  38.             'filterForm'   => $filterForm->createView(),
  39.             'orderForm'    => $orderForm->createView(),
  40.             'items'        => $items,
  41.             'hasFilter'    => $hasFilter || $hasOrder,
  42.             'requireCC'    => !$this->isGranted('WITH_CC'$campaign),
  43.             // Carried onto every item link so the item page's "More Items"
  44.             // carousel can mirror this catalog's sort and filters (CAU-356).
  45.             'carryParams'  => $this->getCatalogCarryParams($request$filterForm$orderForm),
  46.         ]);
  47.     }
  48. }