Skip to content

Commit e193a3b

Browse files
authored
Merge pull request #151 from leroy-merlin-br/chore/update-mongolid-version-3
Update mongolid version 3
2 parents e0f9d6e + 06d092d commit e193a3b

20 files changed

+2239
-1189
lines changed

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,10 @@
5959
"MongoLid": "MongolidLaravel\\MongolidModel"
6060
}
6161
}
62+
},
63+
"config": {
64+
"allow-plugins": {
65+
"dealerdirect/phpcodesniffer-composer-installer": true
66+
}
6267
}
6368
}

composer.lock

Lines changed: 1119 additions & 865 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/FailedJobsService.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use MongoDB\DeleteResult;
77
use MongoDB\Driver\Cursor;
88
use MongoDB\InsertOneResult;
9-
use Mongolid\Connection\Pool;
9+
use Mongolid\Connection\Connection;
1010

1111
/**
1212
* Persistence layer that is used to save failed queue jobs on MongoDB.
@@ -23,17 +23,17 @@ class FailedJobsService
2323
/**
2424
* Connections that are going to be used to interact with database.
2525
*
26-
* @var Pool
26+
* @var Connection
2727
*/
28-
protected $connPool;
28+
protected $connection;
2929

3030
/**
31-
* @param Pool $connPool Connections that are going to be used to interact with MongoDB
32-
* @param string $collection Collection where jobs will be stored
31+
* @param Connection $connection Connections that are going to be used to interact with MongoDB
32+
* @param string $collection Collection where jobs will be stored
3333
*/
34-
public function __construct(Pool $connPool, string $collection = 'failed_jobs')
34+
public function __construct(Connection $connection, string $collection = 'failed_jobs')
3535
{
36-
$this->connPool = $connPool;
36+
$this->connection = $connection;
3737
$this->collection = $collection;
3838
}
3939

@@ -88,9 +88,8 @@ public function drop()
8888
*/
8989
protected function rawCollection(): Collection
9090
{
91-
$conn = $this->connPool->getConnection();
92-
$database = $conn->defaultDatabase;
91+
$database = $this->connection->defaultDatabase;
9392

94-
return $conn->getRawConnection()->$database->{$this->collection};
93+
return $this->connection->getClient()->$database->{$this->collection};
9594
}
9695
}

0 commit comments

Comments
 (0)