(PECL mongo >=1.5.0)
MongoClient::getWriteConcern — Récupère la préoccupation d'écriture pour cette connexion
This extension that defines this method is deprecated. Instead, the MongoDB extension should be used. There is no equivalent for this method in the new extension.
Cette fonction ne contient aucun paramètre.
Cette fonction retourne un tableau décrivant la préoccupation d'écriture. Le tableau contient la valeur w pour le niveau d'approbation (valeur entière), ou un mode sous forme de chaîne de caractères, et la valeur wtimeout indiquant le nombre maximal de millisecondes à attente le serveur pour satisfaire la préoccupation d'écriture.
Exemple #1 Exemple avec MongoClient::getWriteConcern()
<?php
$mc = new MongoClient('mongodb://localhost:27017', array('wTimeoutMS' => 500));
var_dump($mc->getWriteConcern());
$mc->setWriteConcern(1, 1000);
var_dump($mc->getWriteConcern());
?>
L'exemple ci-dessus va afficher :
array(2) { ["w"]=> int(1) ["wtimeout"]=> int(500) } array(2) { ["w"]=> int(1) ["wtimeout"]=> int(1000) }