Commit 84b8b706 authored by Jens Segers's avatar Jens Segers

Fix compatiblity with 5.3

parent 5ba231a1
...@@ -39,7 +39,8 @@ composer require jenssegers/mongodb ...@@ -39,7 +39,8 @@ composer require jenssegers/mongodb
5.0.x | 2.1.x 5.0.x | 2.1.x
5.1.x | 2.2.x or 3.0.x 5.1.x | 2.2.x or 3.0.x
5.2.x | 2.3.x or 3.0.x 5.2.x | 2.3.x or 3.0.x
5.3.x | 3.1.x 5.3.x | 3.1.x or 3.2.x
5.4.x | 3.2.x
And add the service provider in `config/app.php`: And add the service provider in `config/app.php`:
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
convertNoticesToExceptions="true" convertNoticesToExceptions="true"
convertWarningsToExceptions="true" convertWarningsToExceptions="true"
processIsolation="false" processIsolation="false"
stopOnFailure="true" stopOnFailure="false"
syntaxCheck="false" syntaxCheck="false"
verbose="true" verbose="true"
> >
......
...@@ -2,10 +2,34 @@ ...@@ -2,10 +2,34 @@
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Queue\DatabaseQueue; use Illuminate\Queue\DatabaseQueue;
use Jenssegers\Mongodb\Connection;
use MongoDB\Operation\FindOneAndUpdate; use MongoDB\Operation\FindOneAndUpdate;
class MongoQueue extends DatabaseQueue class MongoQueue extends DatabaseQueue
{ {
/**
* The expiration time of a job.
*
* @var int|null
*/
protected $retryAfter = 60;
/**
* The connection name for the queue.
*
* @var string
*/
protected $connectionName;
/**
* @inheritdoc
*/
public function __construct(Connection $database, $table, $default = 'default', $retryAfter = 60)
{
parent::__construct($database, $table, $default, $retryAfter);
$this->retryAfter = $retryAfter;
}
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -15,6 +15,16 @@ class HasMany extends EloquentHasMany ...@@ -15,6 +15,16 @@ class HasMany extends EloquentHasMany
return $this->foreignKey; return $this->foreignKey;
} }
/**
* Get the plain foreign key.
*
* @return string
*/
public function getPlainForeignKey()
{
return $this->getForeignKeyName();
}
/** /**
* Get the key for comparing against the parent key in "has" query. * Get the key for comparing against the parent key in "has" query.
* *
......
...@@ -25,6 +25,16 @@ class HasOne extends EloquentHasOne ...@@ -25,6 +25,16 @@ class HasOne extends EloquentHasOne
return $this->getForeignKeyName(); return $this->getForeignKeyName();
} }
/**
* Get the plain foreign key.
*
* @return string
*/
public function getPlainForeignKey()
{
return $this->getForeignKeyName();
}
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment