<?php
namespace OfficeBrain\Bundle\WishListBundle\Manager\Service;

use Symfony\Component\DependencyInjection\ContainerInterface as Container;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Translation\Translator;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use OfficeBrain\Bundle\WishListBundle\Manager\Extended as WishListManager;

/**
 * @author Employee Id: 4248
 * OB eCommerce Product - WishList
 * WishListServiceClass
 * - Define the extended class
 *
 */
class WishListService
{
    /**
     * @author Employee Id: 4248
     * OB eCommerce Product - Wishlist
     * Function created for decied the name of extented class
     * @param integer $userId
     * @return number
    */
    public static function initFactory($entityManager, $request, $session, $productDetailManager, $paginatorManager)
    {
        $projectSetting = $request->get('project_setting');
        $userId = $projectSetting['user_id'];
        
        if ($userId >0) {
            $classInstance = new WishListManager\WishListRegisteredExtended($entityManager, $request, $session, $productDetailManager, $paginatorManager);
        } else {
            $classInstance = new WishListManager\WishListGuestExtended($entityManager, $request, $session, $productDetailManager, $paginatorManager);
        }
        return $classInstance;
    }
}