src/Factory/DocumentManagerFactory.php
public function createDocumentManager($mongouri, $dbName, $debug = false, $managerId = "", $newConnection = false, $options = [])
    {

        if (!isset($this->connexions[$mongouri])) {
            $client = new Client($mongouri);
        }

        if (!isset($this->managers[$managerId])) {
            $database = new Database($client->getManager(), $dbName);

            $class = $this->repositoryFactoryClass;

            $repositoryFactory = new $class(null, $this->classMetadataFactory);

            $this->managers[$managerId] = new DocumentManager(
                $client,
                $database,
                $repositoryFactory,
                $debug,
                $options,
                []
            );
        }

        return $this->managers[$managerId];
    }
public function createDocumentManager($mongouri, $dbName, $debug = false, $managerId = "", $newConnection = false, $options = [])
    {

        if (!isset($this->connexions[$mongouri])) {
            $client = new Client($mongouri);
        }

        if (!isset($this->managers[$managerId])) {
            $database = new Database($client->getManager(), $dbName);

            $class = $this->repositoryFactoryClass;

            $repositoryFactory = new $class(null, $this->classMetadataFactory);

            $this->managers[$managerId] = new DocumentManager(
                $client,
                $database,
                $repositoryFactory,
                $debug,
                $options,
                []
            );
        }

        return $this->managers[$managerId];
    }
public function createDocumentManager ( $ mongouri , $ dbName , $ debug = false , $ managerId = "" , $ newConnection = false , $ options = [ ] ) { if ( ! isset ( $ this -> connexions [ $ mongouri ] ) ) { $ client = new Client ( $ mongouri ) ; } if ( ! isset ( $ this -> managers [ $ managerId ] ) ) { $ database = new Database ( $ client -> getManager ( ) , $ dbName ) ; $ class = $ this -> repositoryFactoryClass ; $ repositoryFactory = new $ class ( null , $ this -> classMetadataFactory ) ; $ this -> managers [ $ managerId ] = new DocumentManager ( $ client , $ database , $ repositoryFactory , $ debug , $ options , [ ] ) ; } return $ this -> managers [ $ managerId ] ; }
Create new DocumentManager from mongouri and DB name

@param   string                  $mongouri       mongodb uri (mongodb://user:pass@example.org/auth_db)
@param   string                  $dbName         name of the DB where to work
@param   boolean                 $debug          Enable debug mode or not
@param   mixed                   $managerId      Manager unique id
@param   boolean                 $newConnection  Force to open new connection

@return DocumentManager      A DocumentManager connected to mongouri specified
Create new DocumentManager from mongouri and DB name