<?php

namespace OfficeBrain\Bundle\ServiceGroupBundle\Manager\AbstractManager;

/**
 * @author OfficeBrain 4589 <info@officebrain.com>
 *
 * Description : Service Group Abstract Class
 */
abstract class ServiceGroupAbstract extends ServiceGroupBaseAbstract
{
    protected $serviceGroupRepo;
    protected $translator;

    public function __construct($entityManager, $request, $session, $serviceContainer, $countries, $languages, $translator, $coreManager)
    {
        parent::__construct($entityManager, $request, $session, $serviceContainer, $countries, $languages, $coreManager);
        //echo "<pre>",print_r($this->projectSetting['access_rule']['user']['option']['service_group']);exit;
        $this->serviceGroupRepo = $this->entityManager->getRepository('OfficeBrainServiceGroupBundle:ServiceGroup')
                                    ->setProjectSetting($this->projectSetting);
        $this->translator = $translator;
    }

    public function __destruct()
    {
        unset($this->serviceGroupRepo);
        unset($this->translator);
        parent::__destruct();
    }

    public function getBlankObject()
    {
    }

    public function setServiceGroup($form, $id = null)
    {
    }

    public function getServiceGroupList()
    {
    }
    public function getFetchServiceGroup()
    {
    }

    public function getServiceGroupById($id = null)
    {
    }

    public function deleteServiceGroup($id)
    {
    }
    public function copyServiceGroup()
    {
    }
    public function getFormErrors($form, $validator)
    {
    }
    public function filterFormData($form)
    {
    }
    public function makeCopyServiceGroup($serviceGroup, $countryId, $isActive)
    {
    }
    public function copyGroupName($groupName, $languageId, $countryId)
    {
    }

    /**
     * @author Employee Id: 4493
     * OB eCommerce Product - Service Group
     * Function created to get service Group dropdown
     */
    public function getServiceGroup($countryId)
    {
        $serviceGroup=array();

        $serviceGroupResult = $this->entityManager->getRepository('OfficeBrainServiceGroupBundle:ServiceGroup')->getServiceGroupData($countryId, $this->languageId);
        foreach ($serviceGroupResult as $key=>$value) {
            $serviceGroup[$value['id']]=$value['groupName'];
        }
        return $serviceGroup;
    }

    /**
     * @author Employee Id: 4493
     * OB eCommerce Product - Service Group
     * Function created to get service Group dropdown
     */
    public function getServiceDefaultGroup($countryId)
    {
        return $this->entityManager->getRepository('OfficeBrainServiceGroupBundle:ServiceGroup')->getServiceDefaultGroupData($countryId);
    }
}
