Example #1
0
 protected function copyModifiedColumns(BatchJobLog $batchJobLog, BatchJob $batchJob, array $modifiedColumns)
 {
     $shouldSkipInTranslation = array(BatchJobPeer::LOCK_INFO, BatchJobPeer::HISTORY, BatchJobPeer::BATCH_JOB_LOCK_ID, BatchJobPeer::EXECUTION_STATUS);
     foreach ($modifiedColumns as $modifiedColumn) {
         $fieldPosLog = -1;
         try {
             if (in_array($modifiedColumn, $shouldSkipInTranslation)) {
                 if ($modifiedColumn == BatchJobPeer::EXECUTION_STATUS) {
                     $batchJobLog->setAbort($batchJob->getExecutionStatus() == BatchJobExecutionStatus::ABORTED);
                 }
                 continue;
             }
             $fieldName = BatchJobPeer::translateFieldName($modifiedColumn, BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME);
             $fieldPosJob = BatchJobPeer::translateFieldName($modifiedColumn, BasePeer::TYPE_COLNAME, BasePeer::TYPE_NUM);
             $fieldPosLog = BatchJobLogPeer::translateFieldName($fieldName, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM);
         } catch (PropelException $e) {
             KalturaLog::err("Could not set value for BatchJobLog field {$fieldName}, exception thrown: " . $e->getMessage());
         }
         if ($fieldPosLog != -1) {
             $batchJobLog->setByPosition($fieldPosLog, $batchJob->getByPosition($fieldPosJob));
         }
         if ($modifiedColumn == BatchJobPeer::DATA) {
             //set param_1 for the $batchJobLog
             $batchJobData = $batchJob->getData();
             /* @var $batchJobData kBulkUploadJobData */
             $batchJobLog->setParam1($batchJobData->getBulkUploadObjectType());
         }
     }
     return $batchJobLog;
 }
Example #2
0
 public function getFieldNameFromPeer($field_name)
 {
     if ($this->queryFromBatchJob) {
         return BatchJobPeer::translateFieldName($field_name, $this->field_name_translation_type, BasePeer::TYPE_COLNAME);
     } else {
         return BatchJobLockPeer::translateFieldName($field_name, $this->field_name_translation_type, BasePeer::TYPE_COLNAME);
     }
 }
 protected function copyModifiedColumns(BatchJobLog $batchJobLog, BatchJob $batchJob, array $modifiedColumns)
 {
     foreach ($modifiedColumns as $modifiedColumn) {
         try {
             $fieldName = BatchJobPeer::translateFieldName($modifiedColumn, BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME);
             $fieldPosJob = BatchJobPeer::translateFieldName($modifiedColumn, BasePeer::TYPE_COLNAME, BasePeer::TYPE_NUM);
             $fieldPosLog = BatchJobLogPeer::translateFieldName($fieldName, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM);
         } catch (PropelException $e) {
             KalturaLog::err("Could not set value for BatchJobLog field {$fieldName}, exception thrown: " . $e->getMessage());
         }
         $batchJobLog->setByPosition($fieldPosLog, $batchJob->getByPosition($fieldPosJob));
         if ($modifiedColumn == BatchJobPeer::DATA) {
             //set param_1 for the $batchJobLog
             $batchJobData = $batchJob->getData();
             /* @var $batchJobData kBulkUploadJobData */
             $batchJobLog->setParam1($batchJobData->getBulkUploadObjectType());
         }
     }
     return $batchJobLog;
 }
Example #4
0
 /**
  * Sets a field from the object by name passed in as a string.
  *
  * @param      string $name peer name
  * @param      mixed $value field value
  * @param      string $type The type of fieldname the $name is of:
  *                     one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  *                     BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  * @return     void
  */
 public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
 {
     $pos = BatchJobPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
     return $this->setByPosition($pos, $value);
 }
 public function getFieldNameFromPeer($field_name)
 {
     $res = BatchJobPeer::translateFieldName($field_name, $this->field_name_translation_type, BasePeer::TYPE_COLNAME);
     return $res;
 }