<?php

namespace OfficeBrain\Bundle\CmsBundle\Manager\AbstractManager;

/**
 * @author OfficeBrain 4464 <info@officebrain.com>
 *
 * Description : This is the abstract class which contains all the methods of its extended classes.
 **/
abstract class SitemapAbstract
{
    protected $entityManager;
    protected $request;
    protected $projectSettings;
    protected $siteMapRouteRepository;
    protected $siteMapRouteMasterRepository;
    protected $allRoutes;
    protected $categoryApiManager;
    protected $language;
    protected $basePath;
    protected $instanceId;
    protected $cultureCode;
    protected $cmsPageManager;

    /**
     * @author Employee Id: 4464
     *
     * Description : This function is used to set member variables default value
     *
     * @param 1: $entityManager
     * @param 2: $request
     * @param 3: $routerManager
     * @param 4: $categoryApiManager
     * @param 5: $cmsPageManager
     * @param 6: $language
     * @param 7: $basePath
     *
     * @return: NULL
     *
     * @throws Exception: Null
     */
    public function __construct($entityManager, $request, $routerManager, $categoryApiManager, $cmsPageManager, $language, $basePath)
    {
        $this->entityManager = $entityManager;
        $this->request = $request;
        $this->projectSettings = $this->request->get('project_setting');
        $this->allRoutes = $routerManager;
        $this->siteMapRouteRepository = $this->entityManager->getRepository('OfficeBrainCmsBundle:SiteMapRoute');
        $this->siteMapRouteRepository->setProjectSetting($this->projectSettings);
        $this->siteMapRouteMasterRepository = $this->entityManager->getRepository('OfficeBrainCmsBundle:SitemapRouteMaster');
        $this->siteMapRouteMasterRepository->setProjectSetting($this->projectSettings);
        $this->categoryApiManager = $categoryApiManager;
        $this->language = $language;
        $this->basePath = $basePath;
        $this->instanceId = $this->projectSettings['instance_id'];
        $this->cultureCode = $this->projectSettings['culture_code'];
        $this->cmsPageManager = $cmsPageManager;
    }

    /**
     * @author Employee Id: 4464
     *
     * Description : This function is used to unset member variables
     *
     * @param : None
     *
     * @return NULL
     *
     * @throws Exception: Null
     */
    public function __destruct()
    {
        unset($this->entityManager);
        unset($this->request);
        unset($this->projectSettings);
        unset($this->allRoutes);
        unset($this->siteMapRouteRepository);
        unset($this->categoryApiManager);
        unset($this->instanceId);
        unset($this->cultureCode);
        unset($this->cmsPageManager);
    }

    /**
     * @author Employee Id: 4464
     *
     * Description : This function fetches all the system routes and passes the required routes to the controller
     *
     * @param : None
     *
     * @return : total number of routes and system routes
     *
     * @throws Exception : Null
     **/
    public function getSystemRoutes()
    {
    }

    /**
     * @author Employee Id: 4464
     *
     * Description : This function fetches all the pages created by cms
     *
     * @param : None
     *
     * @return : returns all the pages details created by cms
     *
     * @throws Exception : Null
     **/
    public function getPageRoutes()
    {
    }

    /**
     * @author Employee Id: 4464
     *
     * Description : This function fetches all the category and sub categories list
     *
     * @param : None
     *
     * @return category and sub category list array
     *
     * @throws Exception : Null
     **/
    public function getCategorySubCategoryList()
    {
    }

    /**
     * @author Employee Id: 4464
     *
     * Description : This function create actual physical file of the sitemap
     *
     * @param : $routeDetail
     *
     * @return Null
     *
     * @throws Exception : Null
     **/
    public function generateSitemapFile($routeDetail)
    {
    }

    /**
     * @author Employee Id: 4464
     *
     * Description : This function create sub xml files
     *
     * @param 1: $this->basePath
     * @param 2: $data
     * @param 3: $count
     *
     * @return Name of the file (with the path) which is created
     *
     * @throws Exception : Null
     **/
    public function generateSubFile($baseRoute, $data, $count)
    {
    }

    /**
     * @author Employee Id: 4464
     *
     * Description : This function create actual physical file of the sitemap
     *
     * @param 1: $fileName
     * @param 2: $data
     *
     * @return Null
     *
     * @throws Exception : Null
     **/
    public function generateFile($fileName, $data)
    {
    }

    /**
     * @author Employee Id: 4464
     *
     * Description : This function is used to end current file and create a new file
     *
     * @param 1: $this->basePath
     * @param 2: $data
     * @param 3: $counter
     *
     * @return Name of the file (with the path) which is created
     *
     * @throws Exception : Null
     **/
    public function endCreateFile($baseRoute, $data, $counter)
    {
    }

    /**
     * @author Employee Id: 4464
     *
     * Description : Set the public routes into the database
     *
     * @param $instanceId
     *
     * @return : sitemap routes Object
     *
     * @throws Exception: Null
     */
    public function setRoutesInfo($instanceId = null)
    {
    }
}
