public function toObject($object_to_fill = null, $props_to_skip = array())
 {
     $dbFilter = parent::toObject($object_to_fill, $props_to_skip);
     $jobTypeAndSubTypeIn = $this->jobTypeAndSubTypeIn;
     if (is_null($this->jobTypeAndSubTypeIn)) {
         return $dbFilter;
     }
     $finalTypesAndSubTypes = array();
     $arr = explode(BatchJobFilter::JOB_TYPE_AND_SUB_TYPE_MAIN_DELIMITER, $this->jobTypeAndSubTypeIn);
     foreach ($arr as $jobTypeIn) {
         list($jobType, $jobSubTypes) = explode(BatchJobFilter::JOB_TYPE_AND_SUB_TYPE_TYPE_DELIMITER, $jobTypeIn);
         $jobType = kPluginableEnumsManager::apiToCore('BatchJobType', $jobType);
         $finalTypesAndSubTypes[] = $jobType . BatchJobFilter::JOB_TYPE_AND_SUB_TYPE_TYPE_DELIMITER . $jobSubTypes;
     }
     $jobTypeAndSubTypeIn = implode(BatchJobFilter::JOB_TYPE_AND_SUB_TYPE_MAIN_DELIMITER, $finalTypesAndSubTypes);
     $dbFilter->set('_in_job_type_and_sub_type', $jobTypeAndSubTypeIn);
     return $dbFilter;
 }
 function getExclusiveAlmostDone(KalturaExclusiveLockKey $lockKey, $maxExecutionTime, $numberOfJobs, KalturaBatchJobFilter $filter = null, $jobType = null)
 {
     $kparams = array();
     $this->client->addParam($kparams, "lockKey", $lockKey->toParams());
     $this->client->addParam($kparams, "maxExecutionTime", $maxExecutionTime);
     $this->client->addParam($kparams, "numberOfJobs", $numberOfJobs);
     if ($filter !== null) {
         $this->client->addParam($kparams, "filter", $filter->toParams());
     }
     $this->client->addParam($kparams, "jobType", $jobType);
     $this->client->queueServiceActionCall("metadata_metadatabatch", "getExclusiveAlmostDone", $kparams);
     if ($this->client->isMultiRequest()) {
         return null;
     }
     $resultObject = $this->client->doQueue();
     $this->client->throwExceptionIfError($resultObject);
     $this->client->validateObjectType($resultObject, "array");
     return $resultObject;
 }
 /**
  * batch getExclusiveAlmostDone action allows to get a BatchJob that wait for remote closure 
  * 
  * @action getExclusiveAlmostDone
  * @param KalturaExclusiveLockKey $lockKey The unique lock key from the batch-process. Is used for the locking mechanism  
  * @param int $maxExecutionTime The maximum time in seconds the job reguarly take. Is used for the locking mechanism when determining an unexpected termination of a batch-process.
  * @param int $numberOfJobs The maximum number of jobs to return. 
  * @param KalturaBatchJobFilter $filter Set of rules to fetch only rartial list of jobs  
  * @param KalturaBatchJobType $jobType The type of the job - could be a custom extended type
  * @return KalturaBatchJobArray 
  */
 function getExclusiveAlmostDoneAction(KalturaExclusiveLockKey $lockKey, $maxExecutionTime, $numberOfJobs, KalturaBatchJobFilter $filter = null, $jobType = null)
 {
     $jobType = kPluginableEnumsManager::apiToCore('BatchJobType', $jobType);
     $jobsFilter = new BatchJobFilter();
     if ($filter) {
         $jobsFilter = $filter->toFilter($jobType);
     }
     $jobs = kBatchManager::getExclusiveAlmostDoneJobs($lockKey->toObject(), $maxExecutionTime, $numberOfJobs, $jobType, $jobsFilter);
     return KalturaBatchJobArray::fromBatchJobArray($jobs);
 }
 /**
  * list Batch Jobs 
  * 
  * @action listBatchJobs
  * @param KalturaBatchJobFilter $filter
  * @param KalturaFilterPager $pager  
  * @return KalturaBatchJobListResponse
  */
 function listBatchJobsAction(KalturaBatchJobFilter $filter = null, KalturaFilterPager $pager = null)
 {
     if (!$filter) {
         $filter = new KalturaBatchJobFilter();
     }
     $batchJobFilter = new BatchJobFilter();
     $filter->toObject($batchJobFilter);
     $c = new Criteria();
     //		$c->add(BatchJobPeer::DELETED_AT, null);
     $batchJobFilter->attachToCriteria($c);
     if (!$pager) {
         $pager = new KalturaFilterPager();
     }
     $pager->attachToCriteria($c);
     myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL2;
     $list = BatchJobPeer::doSelect($c);
     $c->setLimit(false);
     $count = BatchJobPeer::doCount($c);
     $newList = KalturaBatchJobArray::fromStatisticsBatchJobArray($list);
     $response = new KalturaBatchJobListResponse();
     $response->objects = $newList;
     $response->totalCount = $count;
     return $response;
 }
 public function getOrderByMap()
 {
     return array_merge(parent::getOrderByMap(), $this->order_by_map);
 }