protected function addCallbackJob($type, $job)
{
if (is_object($job) && $job instanceof self) {
$this->data[self::P_CALLBACKS][$type][] = serialize($job);
$this->callbacks[$type][] = $job;
return $this;
}
if (is_string($job)) {
$this->data[self::P_CALLBACKS][$type][] = $job;
$this->callbacks[$type][] = unserialize($job);
return $this;
}
throw new JobException('Callback job must be a serialized string OR object!');
}