Skip to content

Commit 84b8b70

Browse files
committed
Fix compatiblity with 5.3
1 parent 5ba231a commit 84b8b70

File tree

5 files changed

+47
-2
lines changed

5 files changed

+47
-2
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ composer require jenssegers/mongodb
3939
5.0.x | 2.1.x
4040
5.1.x | 2.2.x or 3.0.x
4141
5.2.x | 2.3.x or 3.0.x
42-
5.3.x | 3.1.x
42+
5.3.x | 3.1.x or 3.2.x
43+
5.4.x | 3.2.x
4344

4445
And add the service provider in `config/app.php`:
4546

phpunit.xml.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
convertNoticesToExceptions="true"
88
convertWarningsToExceptions="true"
99
processIsolation="false"
10-
stopOnFailure="true"
10+
stopOnFailure="false"
1111
syntaxCheck="false"
1212
verbose="true"
1313
>

src/Jenssegers/Mongodb/Queue/MongoQueue.php

+24
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,34 @@
22

33
use Carbon\Carbon;
44
use Illuminate\Queue\DatabaseQueue;
5+
use Jenssegers\Mongodb\Connection;
56
use MongoDB\Operation\FindOneAndUpdate;
67

78
class MongoQueue extends DatabaseQueue
89
{
10+
/**
11+
* The expiration time of a job.
12+
*
13+
* @var int|null
14+
*/
15+
protected $retryAfter = 60;
16+
17+
/**
18+
* The connection name for the queue.
19+
*
20+
* @var string
21+
*/
22+
protected $connectionName;
23+
24+
/**
25+
* @inheritdoc
26+
*/
27+
public function __construct(Connection $database, $table, $default = 'default', $retryAfter = 60)
28+
{
29+
parent::__construct($database, $table, $default, $retryAfter);
30+
$this->retryAfter = $retryAfter;
31+
}
32+
933
/**
1034
* @inheritdoc
1135
*/

src/Jenssegers/Mongodb/Relations/HasMany.php

+10
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ public function getForeignKeyName()
1515
return $this->foreignKey;
1616
}
1717

18+
/**
19+
* Get the plain foreign key.
20+
*
21+
* @return string
22+
*/
23+
public function getPlainForeignKey()
24+
{
25+
return $this->getForeignKeyName();
26+
}
27+
1828
/**
1929
* Get the key for comparing against the parent key in "has" query.
2030
*

src/Jenssegers/Mongodb/Relations/HasOne.php

+10
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ public function getHasCompareKey()
2525
return $this->getForeignKeyName();
2626
}
2727

28+
/**
29+
* Get the plain foreign key.
30+
*
31+
* @return string
32+
*/
33+
public function getPlainForeignKey()
34+
{
35+
return $this->getForeignKeyName();
36+
}
37+
2838
/**
2939
* @inheritdoc
3040
*/

0 commit comments

Comments
 (0)