Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace ShopBundle\Controller;
- use AppBundle\Entity\Stockroom;
- use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
- use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
- use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
- use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
- use Symfony\Component\HttpFoundation\Response;
- use UserBundle\Entity\UserClient;
- /**
- * Class BusinessShipmentController
- * @Route("/shop/account/business/client")
- * @package ShopBundle\Controller
- */
- class BusinessShipmentController extends ShipmentController
- {
- /**
- * @Route("/{client_id}/table/{stockroom_id}", name="shop1_client_shipment_table", options={"expose" = true})
- * @Method("GET")
- * @ParamConverter("client", class="UserBundle:UserClient", options={"mapping" = { "client_id" = "id" }})
- * @ParamConverter("stockroom", class="AppBundle:Stockroom", options={"mapping" = { "stockroom_id" = "id" }})
- * @param UserClient $client
- * @param Stockroom $stockroom
- * @return Response
- */
- public function shipmentsClientTableAction(UserClient $client, Stockroom $stockroom)
- {
- $this->sessionSet(self::SESSION_STOCKROOM, $stockroom->getId());
- $isConsolidationActive = $this->getUser()->isShopCountyConsolidationActive();
- $template = $isConsolidationActive ?
- 'ShopBundle:BusinessShipment:shipmentTable.html.twig' :
- 'ShopBundle:BusinessShipment:shipmentTableSimple.html.twig';
- $response['shipments'] = $this->shipmentRepository->getShopShipments($stockroom, $client);
- if ($isConsolidationActive) {
- $response['boxes'] = $this->combineRepository->getShopConsolidations($stockroom, $client);
- }
- return $this->render($template, $response);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement