MongoClient::getReadPreference PHP Метод

getReadPreference() публичный Метод

Get the read preference for this connection
public getReadPreference ( ) : array
Результат array -
    public function getReadPreference()
    {
        return $this->readPreference;
    }

Usage Example

Пример #1
0
 /**
  * Creates a new database
  *
  * This method is not meant to be called directly. The preferred way to create an instance of MongoDB is through {@see Mongo::__get()} or {@see Mongo::selectDB()}.
  * @link http://www.php.net/manual/en/mongodb.construct.php
  * @param MongoClient $conn Database connection.
  * @param string $name Database name.
  * @throws Exception
  * @return MongoDB Returns the database.
  */
 public function __construct(MongoClient $conn, $name)
 {
     $this->connection = $conn;
     $this->name = $name;
     $this->setReadPreferenceFromArray($conn->getReadPreference());
     $this->setWriteConcernFromArray($conn->getWriteConcern());
     $this->createDatabaseObject();
 }
All Usage Examples Of MongoClient::getReadPreference