/** * Creates a new Batch job lock object and saves it. * Pay attention that as part of the save, the batch job sep object is saved as well. * @param BatchJob $batchJob The matching batch job sep object. * @param PropelPDO $con */ public static function createLockObject(BatchJob $batchJob, PropelPDO $con = null) { $batchJobLock = new BatchJobLock(); $batchJobLock->setId($batchJob->getId()); $batchJobLock->setBatchJob($batchJob); $batchJobLock->setEntryId($batchJob->getEntryId()); $batchJobLock->setPartnerId($batchJob->getPartnerId()); $batchJobLock->setDc($batchJob->getDc()); $batchJobLock->setCreatedAt($batchJob->getCreatedAt()); $batchJobLock->setJobType($batchJob->getJobType()); $batchJobLock->setJobSubType($batchJob->getJobSubType()); $batchJobLock->setExecutionAttempts(0); $batchJobLock->setBatchVersion(self::getBatchVersion($batchJob->getJobType())); $batchJobLock->setRootJobId($batchJob->getRootJobId()); self::commonLockObjectUpdate($batchJob, $batchJobLock); $batchJob->setBatchJobLock($batchJobLock); return $batchJobLock->save($con); }