public function deserialize($attributes)
    {
        if (isset($attributes['className'])) {
            $className = $attributes['className'];
            $job = new $className();
            unset($attributes['className']);
            $job->setType($attributes['type']);
            unset($attributes['type']);
            $job->setAttributes($attributes);
            return $job;
        }
    }