<?php
namespace OfficeBrain\Bundle\BannerBundle\Manager\AbstractManager;

use Symfony\Component\HttpFoundation\Request;

/**
 *
 * @author OfficeBrain 4571 <info@officebrain.com>
 *
 * Description : Abstract Class
 *
 */
abstract class BannerMasterAbstract
{
    protected $entityManager;
    protected $request;
    protected $projectSetting;
    protected $instanceId;
    protected $instanceType;
    protected $cultureId;
    protected $cultureCode;
    protected $userId;
    protected $createdUid;
    protected $upatedUid;
    protected $translator;
    protected $knpPaginator;
    
    protected $bannerMasterRepo;
    protected $bannerRepo;
    protected $countryCode;
    protected $languages;
    protected $culture;
    protected $responseArray;
        
    /**
     *
     * @author Employee Id: 4571
     * Description : Initialize the required variable on class load
     *
     * @param : null
     *
     * @return null
     *
     * @throws null
     *
     **/
    public function __construct($entityManager, $request, $translator, $knpPaginator, $country, $language)
    {
        $this->entityManager = $entityManager;
        $this->request = $request;
        $this->projectSetting = $this->request->get('project_setting');
        if ($this->request->get('instance_id') > 0)
        {
        	$this->projectSetting['instance_id'] = $this->request->get('instance_id');
        	$this->projectSetting['instance_type'] = $this->entityManager->getRepository('OfficeBrainAccessManagementBundle:InstanceMaster')->find($this->request->get('instance_id'))->getInstanceType();
        }
        $this->instanceId = $this->projectSetting['instance_id'];
        $this->instanceType = $this->projectSetting['instance_type'];
        $this->userId = $this->projectSetting['user_id'];
        $this->cultureId = $this->projectSetting['culture_id'];
        $this->cultureCode = $this->projectSetting['culture_code'];
        $this->createdUid = $this->userId;
        $this->upatedUid =$this->userId;
        $this->translator = $translator;
        $this->knpPaginator = $knpPaginator;
        $this->entityManager->getRepository('OfficeBrainBannerBundle:BannerMaster')->setProjectSetting($this->projectSetting);
        $this->bannerMasterRepo = $this->entityManager->getRepository('OfficeBrainBannerBundle:BannerMaster');
        $this->bannerRepo = $this->entityManager->getRepository('OfficeBrainBannerBundle:Banner');
        $this->countries =  $country;
        $this->languages = $language;
        $this->culture = $this->request->get('culture', false);
        $this->responseArray = array();
    }
        
    /**
     *
     * @author Employee Id: 4571
     * Description : Unset the variables
     *
     * @param : null
     *
     * @return null
     *
     * @throws null
     *
     **/
    public function __destruct()
    {
        unset($this->entityManager);
        unset($this->request);
        unset($this->projectSetting);
        unset($this->instanceId);
        unset($this->instanceType);
        unset($this->userId);
        unset($this->cultureId);
        unset($this->cultureCode);
        unset($this->createdUid);
        unset($this->upatedUid);
        unset($this->translator);
        unset($this->knpPaginator);
        
        unset($this->countries);
        unset($this->languages);
        unset($this->culture);
        unset($this->knpPaginator);
        unset($this->responseArray);
    }
    
    public function setBannerMaster($bannerMasterObj)
    {
    }
    public function getBannerType($id)
    {
    }
    public function getBannerTypeList()
    {
    }
    public function updateBannerType($bannerMaster)
    {
    }
    public function deleteBannerType()
    {
    }
}
