/** * @param \Illuminate\Database\Connection $database * @param string $table * @param string $default * @param int $expire * @param string $binary * @param string|array $binaryArgs */ public function __construct(Connection $database, $table, $default = 'default', $expire = 60, $binary = 'php', $binaryArgs = '', $connectionName = '') { parent::__construct($database, $table, $default, $expire); $this->binary = $binary; $this->binaryArgs = $binaryArgs; $this->connectionName = $connectionName; }
/** * @param \Illuminate\Database\Connection $database * @param string $table * @param string $default * @param int $expire */ public function __construct(Connection $database, $table, $default = 'default', $expire = 60) { parent::__construct($database, $table, $default, $expire); // TODO: support options (timeout, replica set, customizable write concern level) $dsn = $database->getConfig('dsn'); $options = array("journal" => true, "w" => MongoDB\Driver\WriteConcern::MAJORITY); $driverOptions = array(); $this->client = new MongoDB\Client($dsn, $options, $driverOptions); $this->databaseName = $database->getConfig('database'); }