src/MongoDriver/Actions/MongoDriverAction.php
protected function _attainClient($clientName)
    {
        if (! isset($this->lazyClientOptions[$clientName]) )
            throw new \Exception(sprintf('MongoDB Client (%s) not Registered.', $clientName));


        $conf = $this->lazyClientOptions[$clientName];
        if (! isset($conf['host']) )
            throw new \Exception(sprintf(
                '"host" Option for Client (%s) not given.'
                , $clientName
                , \Poirot\Std\flatten($conf)
            ));

        $uri        = $conf['host'];
        $uriOptions = (isset($conf['options_uri']))    ? $conf['options_uri']    : array();
        $options    = (isset($conf['options_driver'])) ? $conf['options_driver'] : array();

        $client = new MongoDB\Client($uri, $uriOptions, $options);
        return $client;
    }
protected function _attainClient($clientName)
    {
        if (! isset($this->lazyClientOptions[$clientName]) )
            throw new \Exception(sprintf('MongoDB Client (%s) not Registered.', $clientName));


        $conf = $this->lazyClientOptions[$clientName];
        if (! isset($conf['host']) )
            throw new \Exception(sprintf(
                '"host" Option for Client (%s) not given.'
                , $clientName
                , \Poirot\Std\flatten($conf)
            ));

        $uri        = $conf['host'];
        $uriOptions = (isset($conf['options_uri']))    ? $conf['options_uri']    : array();
        $options    = (isset($conf['options_driver'])) ? $conf['options_driver'] : array();

        $client = new MongoDB\Client($uri, $uriOptions, $options);
        return $client;
    }
protected function _attainClient ( $ clientName ) { if ( ! isset ( $ this -> lazyClientOptions [ $ clientName ] ) ) throw new \ Exception ( sprintf ( 'MongoDB Client (%s) not Registered.' , $ clientName ) ) ; $ conf = $ this -> lazyClientOptions [ $ clientName ] ; if ( ! isset ( $ conf [ 'host' ] ) ) throw new \ Exception ( sprintf ( '"host" Option for Client (%s) not given.' , $ clientName , \ Poirot \ Std \ flatten ( $ conf ) ) ) ; $ uri = $ conf [ 'host' ] ; $ uriOptions = ( isset ( $ conf [ 'options_uri' ] ) ) ? $ conf [ 'options_uri' ] : array ( ) ; $ options = ( isset ( $ conf [ 'options_driver' ] ) ) ? $ conf [ 'options_driver' ] : array ( ) ; $ client = new MongoDB \ Client ( $ uri , $ uriOptions , $ options ) ; return $ client ; }
Attain Client Instance from LazyConfigs

@param $clientName

@return MongoDB\Client
@throws \Exception
Attain Client Instance from LazyConfigs