<?php

namespace OfficeBrain\CustomBundle\ProductTagBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use OfficeBrain\Bundle\ProductTagBundle\Controller\ProductTagController As BaseProductTagController;


/**
 * @author OfficeBrain 5058 <info@officebrain.com>
 * Description : Private Tag Controller
 *
 * @Route("/{_locale}/product-tag")
 */
class ProductTagController extends BaseProductTagController
{
	/**
	 * @author Employee Id: 5058
	 * set default value
	 * @return NULL
	 */
	public function __construct()
	{
		parent::__construct();
	}
	
	/**
	 * @author Employee Id: 5058
	 * unset default value
	 * @return NULL
	 */
	public function __destruct()
	{
		parent::__destruct();
	}
	/**
	 *
	 * @author Employee Id: 5058
	 *
	 *         Create various objects required action in this class
	 *
	 * @return NULL
	 */
	public function initAction()
	{
		$this->request = $this->getRequest();
		parent::initAction();
		$this->productTagManager = $this->get('office_brain_custombundle_product_tag_manager');
	}
	
    /**
     * @author Employee Id: 5058
     * Description : Listing of Product Tag.
     * @param : null
     *
     * @Route("/private-tags-list", name="office_brain_pagebundle_privatetag_list",
     * requirements={"records_per_page"="2|4|8|16|996"},
     * defaults={"tag_type"="private","records_per_page"=8,"page"=1,"language"="en"})
     *
     * @Template("OfficeBrainCustomBundleProductTagBundle:Front:/listPrivateTag.html.twig")
     */
    public function listPrivateTagsAction()
    {
    	$this->initAction();
    	
    	$data = $this->productTagManager->setPaggingParameters($this->countryMaster);
    	$data['page_paramater']['status']=1;
    	$data['page_paramater']['current_date']=true;
    	//$data['page_paramater']['event_category_id']=$this->request->get("cat",null);
    	$data['page_paramater']['featured_categories']=$this->container->getParameter('featured_categories');
    	$productTagMasterList = $this->productTagManager->getList($data['page_paramater']);
    	$data['tags']= $productTagMasterList;
    	$data['show_title']=$this->request->get("show_title",1);
    	 
    	//$data['icon_url'] = $this->getParameter('private_tag.icon_url');
    	$data['icon_url'] = $this->featuredIconUrl;
    	 
    	return $this->render('OfficeBrainCustomBundleProductTagBundle:Front:/listPrivateTag.html.twig', $data);
    }
}
