protected function updatedConvert(BatchJob $dbBatchJob, kConvertJobData $data, BatchJob $twinJob = null) { switch ($dbBatchJob->getStatus()) { case BatchJob::BATCHJOB_STATUS_PENDING: return kFlowHelper::handleConvertPending($dbBatchJob, $data, $twinJob); case BatchJob::BATCHJOB_STATUS_QUEUED: return kFlowHelper::handleConvertQueued($dbBatchJob, $data, $twinJob); case BatchJob::BATCHJOB_STATUS_FINISHED: return kFlowHelper::handleConvertFinished($dbBatchJob, $data, $twinJob); case BatchJob::BATCHJOB_STATUS_FAILED: case BatchJob::BATCHJOB_STATUS_FATAL: return kFlowHelper::handleConvertFailed($dbBatchJob, $data, $twinJob); default: return $dbBatchJob; } }