protected function doExecute(\Closure $cb)
    {
        try {
            return $cb($this->manager, $this->collection);
        } catch (\Exception $e) {
            throw Exception\Translator\MongoDb::translate($e);
        }
    }
protected function doExecute(\Closure $cb)
    {
        try {
            return $cb($this->manager, $this->collection);
        } catch (\Exception $e) {
            throw Exception\Translator\MongoDb::translate($e);
        }
    }
protected function doExecute ( \ Closure $ cb ) { try { return $ cb ( $ this -> manager , $ this -> collection ) ; } catch ( \ Exception $ e ) { throw Exception \ Translator \ MongoDb :: translate ( $ e ) ; } }
Executes something in the context of the collection.

Exceptions are caught and translated.

@param callable $cb The closure to execute, takes the entityManager and collection
@return mixed Whatever the function returns, this method also returns
@throws \Caridea\Dao\Exception If a database problem occurs
@see \Caridea\Dao\Exception\Translator\MongoDb
Executes something in the context of the collection .