public function build($aConnection, array $mappingsPaths = [], $isDevMode = true)
    {
        if (empty($mappingsPaths)) {
            $mappingsPaths = [__DIR__ . '/Mapping'];
        }

        Type::addType('user_id', UserIdType::class);
        Type::addType('user_roles', UserRolesType::class);

        return EntityManager::create(
            $aConnection,
            Setup::createYAMLMetadataConfiguration($mappingsPaths, $isDevMode)
        );
    }