public static function buildByConnection($connection, $isDevMode = false)
    {
        $mappings = self::getXMLMappings();
        $config = Setup::createXMLMetadataConfiguration($mappings, $isDevMode);

        $entityManager = EntityManager::create($connection, $config);
        return new self($entityManager);
    }