mirror of
https://github.com/idanoo/php-resque
synced 2025-07-01 05:32:20 +00:00
Making the factory responsible to set the arguments and the queue
This commit is contained in:
parent
de22db6826
commit
8f542e5035
3 changed files with 26 additions and 10 deletions
|
@ -182,13 +182,14 @@ class Resque_Job implements Resque_JobInterface
|
|||
}
|
||||
|
||||
if ($this->jobFactory !== null) {
|
||||
$this->instance = $this->jobFactory->create($this->payload['class']);
|
||||
} else {
|
||||
$this->instance = new $this->payload['class'];
|
||||
$this->instance = $this->jobFactory->create($this->payload['class'], $this->getArguments(), $this->queue);
|
||||
return $this->instance;
|
||||
}
|
||||
$this->instance->job = $this;
|
||||
$this->instance->args = $this->getArguments();
|
||||
$this->instance->queue = $this->queue;
|
||||
$this->instance = new $this->payload['class'];
|
||||
$this->instance->job = $this;
|
||||
$this->instance->args = $this->getArguments();
|
||||
$this->instance->queue = $this->queue;
|
||||
|
||||
return $this->instance;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue