public function complete()
    {
        $this->last_run_date = date('Y-m-d H:i:s', time());
        if (0 != $this->next_task_id) {
            $this->status = DeferredQueue::STATUS_SUCCESS_AND_NEXT;
        } else {
            $this->status = DeferredQueue::STATUS_COMPLETE;
        }

        if ($this->planNextRun() === true) {
            return $this->save();
        } else {
            if ($this->delete_after_run) {
                return $this->delete() !== false;
            } else {
                return $this->save();
            }
        }
    }