public static function fromSchedulerConfigArray($arr)
 {
     $newArr = new KalturaSchedulerConfigArray();
     foreach ($arr as $obj) {
         $nObj = new KalturaSchedulerConfig();
         $nObj->fromObject($obj);
         $newArr[] = $nObj;
     }
     return $newArr;
 }
 public static function fromDbArray(array $arr, KalturaDetachedResponseProfile $responseProfile = null)
 {
     $newArr = new KalturaSchedulerConfigArray();
     foreach ($arr as $obj) {
         $nObj = new KalturaSchedulerConfig();
         $nObj->fromObject($obj, $responseProfile);
         $newArr[] = $nObj;
     }
     return $newArr;
 }
Ejemplo n.º 3
0
 /**
  * batch configLoaded action saves the configuration as loaded by a remote scheduler
  * 
  * @action configLoaded
  * @param KalturaScheduler $scheduler The remote scheduler
  * @param string $configParam The parameter that was loaded
  * @param string $configValue The value that was loaded
  * @param string $configParamPart The parameter part that was loaded
  * @param int $workerConfigId The id of the job that the configuration refers to, not mandatory if the configuration refers to the scheduler
  * @param string $workerName The name of the job that the configuration refers to, not mandatory if the configuration refers to the scheduler 
  * @return KalturaSchedulerConfig
  */
 function configLoadedAction(KalturaScheduler $scheduler, $configParam, $configValue, $configParamPart = null, $workerConfigId = null, $workerName = null)
 {
     $schedulerDb = $this->getOrCreateScheduler($scheduler);
     // saves the loaded config to the DB
     $configDb = new SchedulerConfig();
     $configDb->setSchedulerId($schedulerDb->getId());
     $configDb->setSchedulerName($scheduler->name);
     $configDb->setSchedulerConfiguredId($scheduler->configuredId);
     $configDb->setVariable($configParam);
     $configDb->setVariablePart($configParamPart);
     $configDb->setValue($configValue);
     if ($workerConfigId) {
         $worker = $this->getOrCreateWorker($schedulerDb, $workerConfigId, null, $workerName);
         $configDb->setWorkerId($worker->getId());
         $configDb->setWorkerConfiguredId($workerConfigId);
         $configDb->setWorkerName($workerName);
     }
     $configDb->save();
     $config = new KalturaSchedulerConfig();
     $config->fromObject($configDb, $this->getResponseProfile());
     return $config;
 }