public function toObject($object = null, $skip = array()) { if (is_null($object)) { $object = new kIntegrationJobData(); } $object = parent::toObject($object, $skip); if ($this->providerType && $this->providerData && $this->providerData instanceof KalturaIntegrationJobProviderData) { $providerData = KalturaPluginManager::loadObject('kIntegrationJobProviderData', $this->providerType); if ($providerData) { $providerData = $this->providerData->toObject($providerData); $object->setProviderData($providerData); } } if ($this->triggerType && $this->triggerData && $this->triggerData instanceof KalturaIntegrationJobTriggerData) { $triggerData = KalturaPluginManager::loadObject('kIntegrationJobTriggerData', $this->triggerType); if ($triggerData) { $triggerData = $this->triggerData->toObject($triggerData); $object->setTriggerData($triggerData); } } return $object; }
public function getMapBetweenObjects() { return array_merge(parent::getMapBetweenObjects(), self::$map_between_objects); }
public function toObject($object_to_fill = null, $props_to_skip = array()) { $object = parent::toObject($object_to_fill, $props_to_skip); $entryId = $object->getEntryId(); $entry = entryPeer::retrieveByPK($entryId); $partnerId = $entry->getPartnerId(); $transcriptId = $object->getInputTranscriptId(); $voicebaseOptionsObj = VoicebasePlugin::getPartnerVoicebaseOptions($partnerId); $object->setApiKey($voicebaseOptionsObj->apiKey); $object->setApiPassword($voicebaseOptionsObj->apiPassword); if (!$object->getFlavorAssetId()) { $sourceAsset = assetPeer::retrieveOriginalReadyByEntryId($entryId); if (!$sourceAsset) { throw new KalturaAPIException(KalturaVoicebaseErrors::NO_FLAVOR_ASSET_FOUND, $entryId); } $object->setFlavorAssetId($sourceAsset->getId()); } $voicebaseParamsMap = kConf::get('voicebase', 'integration'); if (!$object->getSpokenLanguage()) { $object->setSpokenLanguage($voicebaseParamsMap['default_language']); } $formatsString = $object->getCaptionAssetFormats(); if ($formatsString) { $formatsArray = explode(',', $formatsString); $excludedFormats = $voicebaseParamsMap['exclude_formats']; $sanitizedFormatsArray = array(); foreach ($formatsArray as $format) { $format = preg_replace("/[^A-Z_]/", "", $format); if (!constant("KalturaCaptionType::" . $format) || in_array($format, $excludedFormats)) { throw new KalturaAPIException(KalturaVoicebaseErrors::INVALID_TYPES, $formatsString); } $sanitizedFormatsArray[] = $format; } $sanitizedFormats = implode(",", $sanitizedFormatsArray); $object->setCaptionAssetFormats($sanitizedFormats); } else { $defaultFormats = implode(",", $voicebaseParamsMap['default_formats']); $object->setCaptionAssetFormats($defaultFormats); } if ($transcriptId) { $transcript = assetPeer::retrieveById($transcriptId); $key = $transcript->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ASSET); $fileSync = FileSyncPeer::retrieveByFileSyncKey($key, true); $object->setFileLocation($fileSync->getFullPath()); } return $object; }
public function toObject($object_to_fill = null, $props_to_skip = array()) { $object = parent::toObject($object_to_fill, $props_to_skip); $entryId = $object->getEntryId(); $entry = entryPeer::retrieveByPK($entryId); $partnerId = $entry->getPartnerId(); $cielo24OptionsObj = Cielo24Plugin::getPartnerCielo24Options($partnerId); $object->setUsername($cielo24OptionsObj->username); $object->setPassword($cielo24OptionsObj->password); if (!$object->getFlavorAssetId()) { $sourceAsset = assetPeer::retrieveOriginalReadyByEntryId($entryId); if (!$sourceAsset) { throw new KalturaAPIException(KalturaCielo24Errors::NO_FLAVOR_ASSET_FOUND, $entryId); } $object->setFlavorAssetId($sourceAsset->getId()); } $cielo24ParamsMap = kConf::get('cielo24', 'integration'); if (!$object->getSpokenLanguage()) { $object->setSpokenLanguage($cielo24ParamsMap['default_language']); } $formatsString = $object->getCaptionAssetFormats(); if ($formatsString) { $formatsArray = explode(',', $formatsString); $excludedFormats = $cielo24ParamsMap['exclude_formats']; $sanitizedFormatsArray = array(); foreach ($formatsArray as $format) { $format = preg_replace("/[^A-Z_]/", "", $format); if (!constant("KalturaCaptionType::" . $format) || in_array($format, $excludedFormats)) { throw new KalturaAPIException(KalturaCielo24Errors::INVALID_TYPES, $formatsString); } $sanitizedFormatsArray[] = $format; } $sanitizedFormats = implode(",", $sanitizedFormatsArray); $object->setCaptionAssetFormats($sanitizedFormats); } else { $defaultFormats = implode(",", $cielo24ParamsMap['default_formats']); $object->setCaptionAssetFormats($defaultFormats); } if (!$object->getPriority()) { $object->setPriority($cielo24ParamsMap['default_priority']); } if (!$object->getFidelity()) { $object->setFidelity($cielo24ParamsMap['default_fidelity']); } return $object; }
public function toObject($object_to_fill = null, $props_to_skip = array()) { $object = parent::toObject($object_to_fill, $props_to_skip); $entryId = $object->getEntryId(); $entry = entryPeer::retrieveByPK($entryId); $partnerId = $entry->getPartnerId(); $transcriptId = $object->getInputTranscriptId(); $voicebaseOptionsObj = VoicebasePlugin::getPartnerVoicebaseOptions($partnerId); $object->setApiKey($voicebaseOptionsObj->apiKey); $object->setApiPassword($voicebaseOptionsObj->apiPassword); if ($transcriptId) { $transcript = assetPeer::retrieveById($transcriptId); $key = $transcript->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ASSET); $fileSync = FileSyncPeer::retrieveByFileSyncKey($key, true); $object->setFileLocation($fileSync->getFullPath()); } return $object; }