<?php

namespace Sso\BackendBundle\Database\Data;

use Doctrine\Bundle\DoctrineBundle\Registry as DoctrineRegistry;
use Doctrine\ORM\EntityRepository;

class Factory
{

    /**
     * list of this manager
     *
     * @var array
     */
    protected $manSetter;

    /**
     *
     * @var DoctrineRegistry
     */
    protected $doctrineRegistry;

    /**
     *
     * @param DoctrineRegistry $doctrineRegistry
     */
    public function __construct(DoctrineRegistry $doctrineRegistry)
    {
        $this->doctrineRegistry = $doctrineRegistry;
    }

    /**
     *
     * @return EntityRepository
     */
    public function import()
    {
        if (!isset($this->manSetter['import'])) {
            $this->manSetter['import'] = $this->doctrineRegistry->getRepository('SsoBackendBundle:Import', 'Backend');
        }
        return $this->manSetter['import'];
    }
}