Exemplo n.º 1
0
/**
 * Converts a ReadConcern instance to a stdClass for use in a BSON document.
 *
 * @internal
 * @see https://jira.mongodb.org/browse/PHPC-498
 * @param ReadConcern $readConcern Read concern
 * @return stdClass
 */
function read_concern_as_document(ReadConcern $readConcern)
{
    $document = [];
    if ($readConcern->getLevel() !== null) {
        $document['level'] = $readConcern->getLevel();
    }
    return (object) $document;
}
Exemplo n.º 2
0
 /**
  * Converts a ReadConcern instance to a stdClass for use in a BSON document.
  *
  * @internal
  * @see https://jira.mongodb.org/browse/PHPC-498
  *
  * @param ReadConcern $readConcern Read concern
  *
  * @return stdClass
  */
 public static function readConcernAsDocument(ReadConcern $readConcern)
 {
     $document = [];
     if ($readConcern->getLevel() !== null) {
         $document['level'] = $readConcern->getLevel();
     }
     return (object) $document;
 }