<?php
 namespace MongoDB\Operation;
 use MongoDB\Driver\Exception\RuntimeException as DriverRuntimeException;
 use MongoDB\Driver\Server;
 use MongoDB\Exception\InvalidArgumentException;
 use MongoDB\Exception\UnexpectedValueException;
 use MongoDB\Exception\UnsupportedException;
 use function array_intersect_key;
 class EstimatedDocumentCount implements Executable, Explainable {
 private $databaseName;
 private $collectionName;
 private $options;
 private $count;
 public function __construct($databaseName, $collectionName, array $options = []) {
 $this->databaseName = (string) $databaseName;
 $this->collectionName = (string) $collectionName;
 $this->options = array_intersect_key($options, ['maxTimeMS' => 1, 'readConcern' => 1, 'readPreference' => 1, 'session' => 1]);
 $this->count = $this->createCount();
 }
 public function execute(Server $server) {
 return $this->count->execute($server);
 }
 public function getCommandDocument(Server $server) {
 return $this->count->getCommandDocument($server);
 }
 private function createCount() {
 return new Count($this->databaseName, $this->collectionName, [], $this->options);
 }
 }
 