public function createBaseEm($env)
    {
        if($env == 'dev')
        {
            $devEnv = true;
        }
        else
        {
            $devEnv = false;
        }

        AnnotationRegistry::registerFile($this->paths['root'] . '/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
        AnnotationRegistry::registerAutoloadNamespace('Symfony\Component\Validator\Constraints', $this->paths['root'] . '/vendor/symfony/validator');

        $reader = new FileCacheReader(new AnnotationReader(), $this->paths['app'] . '/cache/doctrine/annotations', $debug = true);

        $driverImpl = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader, array($this->paths['src']."/Model"));
        $config = Setup::createAnnotationMetadataConfiguration(array($this->paths['src']."/Model"), $devEnv);
        $config->setMetadataDriverImpl($driverImpl);
        $conn = $this->getParams();

        $this->em = EntityManager::create($conn, $config);
    }