lib/Doctrine/MongoDB/Query/Query.php
private function withPrimaryReadPreference($object, \Closure $closure)
    {
        $this->query['readPreference'] = \MongoClient::RP_PRIMARY;
        $this->query['readPreferenceTags'] = null;

        return $this->withReadPreference($object, $closure);
    }
private function withPrimaryReadPreference($object, \Closure $closure)
    {
        $this->query['readPreference'] = \MongoClient::RP_PRIMARY;
        $this->query['readPreferenceTags'] = null;

        return $this->withReadPreference($object, $closure);
    }
private function withPrimaryReadPreference ( $ object , \ Closure $ closure ) { $ this -> query [ 'readPreference' ] = \ MongoClient :: RP_PRIMARY ; $ this -> query [ 'readPreferenceTags' ] = null ; return $ this -> withReadPreference ( $ object , $ closure ) ; }
Executes a closure with a temporary primary read preference on a database
or collection.

@param Database|Collection $object
@param \Closure            $closure
@return mixed
Executes a closure with a temporary primary read preference on a database or collection .