<?php

namespace VGM\WOBundle\Controller;

use Symfony\Component\Config\Definition\Exception\Exception;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

use Doctrine\ORM\EntityRepository;

use VGM\WOBundle\Entity\WorkOrder;
use VGM\WOBundle\Entity\Stock;
use VGM\WOBundle\Entity\WorkOrderStockAssociation;

/**
 * Stickers controller.
 *
 */
class StickersController extends Controller
{
    public function ShowWorkOrderStickersAction($id){
        $em = $this->getDoctrine()->getEntityManager();
        $entity = $em->getRepository('VGMWOBundle:WorkOrder')->find($id);
        return $this->render('VGMWOBundle:WorkOrder:print_stickers.html.twig', array('entity' => $entity,'wflag'=>true));
    }
    public function ShowStockStickersAction($id){
        $em = $this->getDoctrine()->getEntityManager();
        $entity = $em->getRepository('VGMWOBundle:WorkOrderStockAssociation')->find($id);
        return $this->render('VGMWOBundle:WorkOrder:print_stickers.html.twig', array('entity' => $entity,'wflag'=>false));
    }
}
