public function build(Connection $aConnection = null)
    {
        Type::addType('user_email', UserEmailType::class);
        Type::addType('user_id', UserIdType::class);
        Type::addType('user_password', UserPasswordType::class);
        Type::addType('user_roles', UserRolesType::class);
        Type::addType('user_token', UserTokenType::class);

        $configuration = new Configuration();
        $driver = new YamlDriver([__DIR__ . '/Mapping']);
        $configuration->setMetadataDriverImpl($driver);
        $configuration->setProxyDir(__DIR__ . '/Proxies');
        $configuration->setProxyNamespace('Proxies');
        $configuration->setHydratorDir(__DIR__ . '/Hydrators');
        $configuration->setHydratorNamespace('Hydrators');

        return DocumentManager::create($aConnection, $configuration);
    }
public function build(Connection $aConnection = null)
    {
        Type::addType('user_email', UserEmailType::class);
        Type::addType('user_id', UserIdType::class);
        Type::addType('user_password', UserPasswordType::class);
        Type::addType('user_roles', UserRolesType::class);
        Type::addType('user_token', UserTokenType::class);

        $configuration = new Configuration();
        $driver = new YamlDriver([__DIR__ . '/Mapping']);
        $configuration->setMetadataDriverImpl($driver);
        $configuration->setProxyDir(__DIR__ . '/Proxies');
        $configuration->setProxyNamespace('Proxies');
        $configuration->setHydratorDir(__DIR__ . '/Hydrators');
        $configuration->setHydratorNamespace('Hydrators');

        return DocumentManager::create($aConnection, $configuration);
    }
public function build ( Connection $ aConnection = null ) { Type :: addType ( 'user_email' , UserEmailType :: class ) ; Type :: addType ( 'user_id' , UserIdType :: class ) ; Type :: addType ( 'user_password' , UserPasswordType :: class ) ; Type :: addType ( 'user_roles' , UserRolesType :: class ) ; Type :: addType ( 'user_token' , UserTokenType :: class ) ; $ configuration = new Configuration ( ) ; $ driver = new YamlDriver ( [ __DIR__ . '/Mapping' ] ) ; $ configuration -> setMetadataDriverImpl ( $ driver ) ; $ configuration -> setProxyDir ( __DIR__ . '/Proxies' ) ; $ configuration -> setProxyNamespace ( 'Proxies' ) ; $ configuration -> setHydratorDir ( __DIR__ . '/Hydrators' ) ; $ configuration -> setHydratorNamespace ( 'Hydrators' ) ; return DocumentManager :: create ( $ aConnection , $ configuration ) ; }
Creates an document manager instance enabling mappings and custom types.

@param Connection|null $aConnection The MongoDB connection, it can be null

@return DocumentManager
Creates an document manager instance enabling mappings and custom types .