Enable __set() in Jobs, so all data is stored in _data
This commit is contained in:
parent
4ff944cb3a
commit
15a6933026
@ -22,16 +22,16 @@ final class DeleteChat extends Job
|
||||
public function __construct(Model $o,string $ts)
|
||||
{
|
||||
if ($o instanceof Channel) {
|
||||
$this->_data['cid'] = $o->channel_id;
|
||||
$this->cid = $o->channel_id;
|
||||
|
||||
} elseif ($o instanceof User) {
|
||||
$this->_data['cid'] = $o->user_id;
|
||||
$this->cid = $o->user_id;
|
||||
|
||||
} else
|
||||
throw new \Exception('Invalid Model: '.get_class($o));
|
||||
|
||||
$this->_data['to'] = $o->team;
|
||||
$this->_data['ts'] = $ts;
|
||||
$this->to = $o->team;
|
||||
$this->ts = $ts;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -29,4 +29,8 @@ abstract class Job implements ShouldQueue
|
||||
{
|
||||
return Arr::get($this->_data,$key);
|
||||
}
|
||||
|
||||
public function __set(string $key,$value) {
|
||||
return $this->_data->put($key,$value);
|
||||
}
|
||||
}
|
@ -18,7 +18,7 @@ class TeamUpdate extends Job
|
||||
*/
|
||||
public function __construct(Team $to)
|
||||
{
|
||||
$this->_data['to'] = $to;
|
||||
$this->to = $to;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
|
Loading…
Reference in New Issue
Block a user