public function registerAnnotationBasedEntities($namespace, $directory) {
        $mappingDriver = InstallUtils::getOrCreateInstance('mappingDriver.'.$namespace, null, $this->moufManager);
        $mappingDriver->setCode('return new Doctrine\\ORM\\Mapping\\Driver\\AnnotationDriver($container->get(\'annotationReader\'), [ROOT_PATH . "'.$directory.'"]);');

        $this->addDriverToChain($namespace, $mappingDriver);
    }