public function doFromObject($sourceObject, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($sourceObject, $responseProfile);
     if ($this->shouldGet('scheduleUpdateEnabled', $responseProfile)) {
         $this->scheduleUpdateEnabled = $sourceObject->isScheduleUpdateEnabled();
     }
     if ($this->shouldGet('availabilityUpdateEnabled', $responseProfile)) {
         $this->availabilityUpdateEnabled = $sourceObject->isAvailabilityUpdateEnabled();
     }
     if ($this->shouldGet('deleteInsteadUpdate', $responseProfile)) {
         $this->deleteInsteadUpdate = $sourceObject->useDeleteInsteadOfUpdate();
     }
     if ($this->shouldGet('intervalBeforeSunrise', $responseProfile)) {
         $this->intervalBeforeSunrise = $sourceObject->getJobIntervalBeforeSunrise();
     }
     if ($this->shouldGet('intervalBeforeSunset', $responseProfile)) {
         $this->intervalBeforeSunset = $sourceObject->getJobIntervalBeforeSunset();
     }
     if ($this->shouldGet('updateRequiredEntryFields', $responseProfile)) {
         $this->updateRequiredEntryFields = $sourceObject->getUpdateRequiredEntryFields();
     }
     if ($this->shouldGet('updateRequiredMetadataXPaths', $responseProfile)) {
         $this->updateRequiredMetadataXPaths = $sourceObject->getUpdateRequiredMetadataXPaths();
     }
 }
 public function doFromObject($source_object, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($source_object, $responseProfile);
     if ($this->shouldGet('updateParams', $responseProfile)) {
         $this->updateParams = KalturaStringArray::fromStringArray($source_object->getUpdateParams());
     }
 }
Пример #3
0
 public function doFromObject($dbData, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($dbData, $responseProfile);
     $statusesArray = $dbData->getStatuses();
     if (is_array($statusesArray)) {
         $this->statuses = KalturaSchedulerStatusArray::fromValuesArray($statusesArray, $this->schedulerId, $this->schedulerConfiguredId, $this->id, $this->configuredId, $this->type);
     }
     $this->configs = KalturaSchedulerConfigArray::fromDbArray($dbData->getConfigs());
     $this->lockedJobs = KalturaBatchJobArray::fromBatchJobArray($dbData->getLockedJobs());
     return $this;
 }
Пример #4
0
 public function doFromObject($sourceObject, KalturaDetachedResponseProfile $responseProfile = null)
 {
     if (!$sourceObject) {
         return;
     }
     parent::doFromObject($sourceObject, $responseProfile);
     if ($this->shouldGet('entryFilter', $responseProfile)) {
         $entryFilter = $sourceObject->getEntryFilterObject();
         if ($entryFilter) {
             $this->entryFilter = new KalturaBaseEntryFilter();
             $this->entryFilter->fromObject($entryFilter);
         }
     }
 }
Пример #5
0
 public function doFromObject($source_object, KalturaDetachedResponseProfile $responseProfile = null)
 {
     /* @var $source_object CaptionAssetItem */
     $ret = parent::doFromObject($source_object, $responseProfile);
     if ($this->shouldGet('asset', $responseProfile)) {
         $this->asset = new KalturaCaptionAsset();
         $this->asset->fromObject($source_object->getAsset());
     }
     if ($this->shouldGet('entry', $responseProfile)) {
         $entry = $source_object->getEntry();
         if ($entry) {
             $this->entry = KalturaEntryFactory::getInstanceByType($entry->getType());
             $this->entry->fromObject($entry);
         }
     }
     return $ret;
 }
 public function doFromObject($dbObject, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($dbObject, $responseProfile);
     /* @var $dbObject kExtendingItemMrssParameter */
     if ($this->shouldGet('identifier', $responseProfile)) {
         $identifierType = get_class($dbObject->getIdentifier());
         KalturaLog::info("Creating identifier for DB identifier type {$identifierType}");
         switch ($identifierType) {
             case 'kEntryIdentifier':
                 $this->identifier = new KalturaEntryIdentifier();
                 break;
             case 'kCategoryIdentifier':
                 $this->identifier = new KalturaCategoryIdentifier();
         }
         if ($this->identifier) {
             $this->identifier->fromObject($dbObject->getIdentifier());
         }
     }
 }
 public function doFromObject($dbObject, KalturaDetachedResponseProfile $responseProfile = null)
 {
     /* @var $dbObject kEventValueCondition */
     parent::doFromObject($dbObject, $responseProfile);
     $valueType = get_class($dbObject->getValue());
     KalturaLog::debug("Loading KalturaStringValue from type [{$valueType}]");
     switch ($valueType) {
         case 'kStringValue':
             $this->value = new KalturaStringValue();
             break;
         case 'kEvalStringField':
             $this->value = new KalturaEvalStringField();
             break;
         default:
             $this->value = KalturaPluginManager::loadObject('KalturaStringValue', $valueType);
             break;
     }
     if ($this->value) {
         $this->value->fromObject($dbObject->getValue());
     }
 }
 public function doFromObject($dbObject, KalturaDetachedResponseProfile $responseProfile = null)
 {
     /* @var $dbObject kEmailNotificationRecipient */
     parent::doFromObject($dbObject, $responseProfile);
     $emailType = get_class($dbObject->getEmail());
     KalturaLog::debug("Loading KalturaStringValue from type [{$emailType}]");
     switch ($emailType) {
         case 'kStringValue':
             $this->email = new KalturaStringValue();
             break;
         case 'kEvalStringField':
             $this->email = new KalturaEvalStringField();
             break;
         case 'kUserEmailContextField':
             $this->email = new KalturaUserEmailContextField();
             break;
         default:
             $this->email = KalturaPluginManager::loadObject('KalturaStringValue', $emailType);
             break;
     }
     if ($this->email) {
         $this->email->fromObject($dbObject->getEmail());
     }
     $nameType = get_class($dbObject->getName());
     KalturaLog::debug("Loading KalturaStringValue from type [{$nameType}]");
     switch ($nameType) {
         case 'kStringValue':
             $this->name = new KalturaStringValue();
             break;
         case 'kEvalStringField':
             $this->name = new KalturaEvalStringField();
             break;
         default:
             $this->name = KalturaPluginManager::loadObject('KalturaStringValue', $nameType);
             break;
     }
     if ($this->name) {
         $this->name->fromObject($dbObject->getName());
     }
 }
Пример #9
0
 public function doFromObject($batchJobObject, KalturaDetachedResponseProfile $responseProfile = null)
 {
     /* @var $batchJobObject BatchJobLog */
     if (is_null($batchJobObject)) {
         return null;
     }
     if ($batchJobObject->getJobType() != BatchJobType::BULKUPLOAD) {
         throw new Exception("Bulk upload object can be initialized from bulk upload job only");
     }
     parent::doFromObject($batchJobObject, $responseProfile);
     $this->uploadedOn = $batchJobObject->getCreatedAt(null);
     $this->logFileUrl = requestUtils::getHost() . "/api_v3/service/bulkUpload/action/serveLog/id/{$batchJobObject->getJobId()}/ks/" . kCurrentContext::$ks;
     //		$this->logFileUrl = requestUtils::getHost() . "/index.php/extwidget/bulkuploadfile/id/{$batchJob->getId()}/pid/{$batchJob->getPartnerId()}/type/log";
     $this->bulkFileUrl = requestUtils::getHost() . "/api_v3/service/bulkUpload/action/serve/id/{$batchJobObject->getJobId()}/ks/" . kCurrentContext::$ks;
     //		$this->bulkFileUrl = requestUtils::getCdnHost() . "/index.php/extwidget/bulkuploadfile/id/{$batchJob->getId()}/pid/{$batchJob->getPartnerId()}/type/$type";
     $this->csvFileUrl = $this->bulkFileUrl;
     if (method_exists(get_class($batchJobObject), "getParam1")) {
         $this->bulkUploadObjectType = $batchJobObject->getParam1();
     }
     //if (isset ())
     $jobData = $batchJobObject->getData();
     if ($jobData && $jobData instanceof kBulkUploadJobData) {
         $this->uploadedBy = $jobData->getUploadedBy();
         $this->uploadedByUserId = $jobData->getUserId();
         $this->numOfEntries = $jobData->getNumOfEntries();
         $this->numOfObjects = $jobData->getNumOfObjects();
         $this->fileName = $jobData->getFileName();
         $this->bulkUploadObjectType = BulkUploadObjectType::ENTRY;
         if ($jobData->getBulkUploadObjectType()) {
             $this->bulkUploadObjectType = $jobData->getBulkUploadObjectType();
         }
         if (!$jobData->getFilePath()) {
             $this->csvFileUrl = null;
             $this->bulkFileUrl = null;
         }
     }
 }
Пример #10
0
 public function doFromObject($sourceObject, KalturaDetachedResponseProfile $responseProfile = null)
 {
     if (!$sourceObject) {
         return;
     }
     parent::doFromObject($sourceObject, $responseProfile);
     // full name is deprecated and was split to firstName + lastName
     // this is for backward compatibility
     if ($this->shouldGet('fullName', $responseProfile)) {
         $this->fullName = $sourceObject->getFullName();
     }
     if ($this->shouldGet('loginEnabled', $responseProfile)) {
         $this->loginEnabled = !is_null($sourceObject->getLoginDataId());
     }
 }
Пример #11
0
 public function doFromObject($partner, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($partner);
     $this->name = kString::stripUtf8InvalidChars($this->name);
     $this->description = kString::stripUtf8InvalidChars($this->description);
     $this->adminName = kString::stripUtf8InvalidChars($this->adminName);
     $this->additionalParams = KalturaKeyValueArray::fromKeyValueArray($partner->getAdditionalParams());
     if (!$this->host) {
         $this->host = null;
     }
     if (!$this->cdnHost) {
         $this->cdnHost = null;
     }
 }
Пример #12
0
 public function doFromObject($source_object, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($source_object, $responseProfile);
     $this->fileUrl = $source_object->getExternalUrl($this->getEntryId($source_object));
     $this->isCurrentDc = $source_object->getDc() == kDataCenterMgr::getCurrentDcId();
     if ($this->fileType == KalturaFileSyncType::LINK) {
         $fileSync = kFileSyncUtils::resolve($source_object);
         $this->fileRoot = $fileSync->getFileRoot();
         $this->filePath = $fileSync->getFilePath();
     }
     if ($this->isCurrentDc) {
         $path = $this->fileRoot . $this->filePath;
         $this->fileDiscSize = kFile::fileSize($path);
         $content = file_get_contents($path, false, null, 0, 1024);
         if (ctype_print($content) || ctype_cntrl($content)) {
             $this->fileContent = $content;
         }
     }
 }
Пример #13
0
 public function doFromObject($source_object, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($source_object, $responseProfile);
     // copy permission items IDs
     if ($this->shouldGet('permissionItemsIds', $responseProfile)) {
         $itemIdsArray = $source_object->getPermissionItemIds();
         if ($itemIdsArray && count($itemIdsArray) > 0) {
             $this->permissionItemsIds = implode(',', $itemIdsArray);
         }
     }
 }
Пример #14
0
 public function doFromObject($sourceObject, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($sourceObject, $responseProfile);
     if ($this->shouldGet('xslTransformation', $responseProfile)) {
         $this->xslTransformation = $sourceObject->getXsl();
     }
     if ($this->shouldGet('cropDimensions', $responseProfile)) {
         $this->cropDimensions = new KalturaCropDimensions();
         $this->cropDimensions->fromObject($sourceObject);
     }
 }
Пример #15
0
 protected function doFromObject($sourceObject, KalturaDetachedResponseProfile $responseProfile = null)
 {
     if (!$sourceObject) {
         return;
     }
     parent::doFromObject($sourceObject, $responseProfile);
     if ($this->shouldGet('optionalThumbDimensions', $responseProfile)) {
         $this->optionalThumbDimensions = KalturaDistributionThumbDimensionsArray::fromDbArray($sourceObject->getOptionalThumbDimensionsObjects());
     }
     if ($this->shouldGet('requiredThumbDimensions', $responseProfile)) {
         $this->requiredThumbDimensions = KalturaDistributionThumbDimensionsArray::fromDbArray($sourceObject->getRequiredThumbDimensionsObjects());
     }
     if ($this->shouldGet('optionalAssetDistributionRules', $responseProfile)) {
         $this->optionalAssetDistributionRules = KalturaAssetDistributionRulesArray::fromDbArray($sourceObject->getOptionalAssetDistributionRules());
     }
     if ($this->shouldGet('requiredAssetDistributionRules', $responseProfile)) {
         $this->requiredAssetDistributionRules = KalturaAssetDistributionRulesArray::fromDbArray($sourceObject->getRequiredAssetDistributionRules());
     }
 }
Пример #16
0
 public function doFromObject($source_object, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($source_object, $responseProfile);
     if ($this->shouldGet('xsd', $responseProfile)) {
         $key = $source_object->getSyncKey(MetadataProfile::FILE_SYNC_METADATA_DEFINITION);
         $this->xsd = kFileSyncUtils::file_get_contents($key, true, false);
     }
     if ($this->shouldGet('views', $responseProfile)) {
         $key = $source_object->getSyncKey(MetadataProfile::FILE_SYNC_METADATA_VIEWS);
         $this->views = kFileSyncUtils::file_get_contents($key, true, false);
     }
     if ($this->shouldGet('xslt', $responseProfile)) {
         $key = $source_object->getSyncKey(MetadataProfile::FILE_SYNC_METADATA_XSLT);
         $this->xslt = kFileSyncUtils::file_get_contents($key, true, false);
     }
 }
Пример #17
0
 public function doFromObject($source_object, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($source_object, $responseProfile);
     if ($this->shouldGet('fileUrl', $responseProfile)) {
         $this->fileUrl = $source_object->getExternalUrl($this->getEntryId($source_object));
     }
     if ($this->shouldGet('isCurrentDc', $responseProfile)) {
         $this->isCurrentDc = $source_object->getDc() == kDataCenterMgr::getCurrentDcId();
     }
     if ($source_object->getFileType() == FileSync::FILE_SYNC_FILE_TYPE_LINK && ($this->shouldGet('fileRoot', $responseProfile) || $this->shouldGet('filePath', $responseProfile))) {
         $fileSync = kFileSyncUtils::resolve($source_object);
         $this->fileRoot = $fileSync->getFileRoot();
         $this->filePath = $fileSync->getFilePath();
     }
     if ($source_object->getDc() == kDataCenterMgr::getCurrentDcId()) {
         $path = $source_object->getFullPath();
         if ($this->shouldGet('fileDiscSize', $responseProfile)) {
             $this->fileDiscSize = kFile::fileSize($path);
         }
         if ($this->shouldGet('fileContent', $responseProfile)) {
             $content = file_get_contents($path, false, null, 0, 1024);
             if (ctype_print($content) || ctype_cntrl($content)) {
                 $this->fileContent = $content;
             }
         }
     }
 }
Пример #18
0
 /**
  * @param AuditTrail $dbAuditTrail
  */
 public function doFromObject($dbAuditTrail, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($dbAuditTrail, $responseProfile);
     if ($this->shouldGet('data', $responseProfile)) {
         $dbData = $dbAuditTrail->getData();
         switch (get_class($dbData)) {
             case 'kAuditTrailChangeInfo':
                 $this->data = new KalturaAuditTrailChangeInfo();
                 break;
             case 'kAuditTrailFileSyncCreateInfo':
                 $this->data = new KalturaAuditTrailFileSyncCreateInfo();
                 break;
             case 'kAuditTrailTextInfo':
                 $this->data = new KalturaAuditTrailTextInfo();
                 break;
             default:
                 //				$this->data = new KalturaAuditTrailInfo();
                 $this->data = null;
                 break;
         }
         if ($this->data && $dbData) {
             $this->data->fromObject($dbData);
         }
     }
 }
Пример #19
0
 public function doFromObject($source_object, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($source_object, $responseProfile);
     if ($this->shouldGet('status', $responseProfile) && !is_null($source_object->getHeartbeatTime()) && $source_object->getHeartbeatTime(null) < time() - ServerNode::SERVER_NODE_TTL_TIME && $this->status !== ServerNodeStatus::DISABLED) {
         $this->status = ServerNodeStatus::NOT_REGISTERED;
     }
 }
Пример #20
0
 public function doFromObject($source_object, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($source_object, $responseProfile);
     if ($this->shouldGet('feedUrl', $responseProfile) && isset($this->id) && $this->id) {
         $this->feedUrl = kConf::get('apphome_url') . '/api_v3/getFeed.php';
         if ($this->partnerId) {
             $this->feedUrl .= '?partnerId=' . $this->partnerId . '&';
         } else {
             $this->feedUrl .= '?';
         }
         $this->feedUrl .= 'feedId=' . $this->id;
     }
 }
Пример #21
0
 /**
  * @param Scheduler $dbData
  * @return KalturaScheduler
  */
 public function doFromObject($dbData, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($dbData, $responseProfile);
     $statusesArray = $dbData->getStatuses();
     if (is_array($statusesArray)) {
         $this->statuses = KalturaSchedulerStatusArray::fromValuesArray($statusesArray, $this->id, $this->configuredId);
     }
     $this->lastStatusStr = date('d-m-Y H:i:s', $this->lastStatus);
     return $this;
 }
Пример #22
0
 public function doFromObject($source_object, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($source_object, $responseProfile);
     if ($this->shouldGet('pathManagerParams', $responseProfile)) {
         $this->pathManagerParams = KalturaKeyValueArray::fromKeyValueArray($source_object->getPathManagerParams());
     }
     if ($this->shouldGet('deliveryProfileIds', $responseProfile)) {
         $this->deliveryProfileIds = KalturaKeyValueArray::fromKeyValueArray($source_object->getDeliveryProfileIds());
     }
 }
Пример #23
0
 public function doFromObject($sourceObject, KalturaDetachedResponseProfile $responseProfile = null)
 {
     if (!$sourceObject) {
         return;
     }
     parent::doFromObject($sourceObject, $responseProfile);
     if ($this->shouldGet('recognizer', $responseProfile)) {
         $this->recognizer = $this->transformRecognizer($sourceObject);
     }
     if ($this->shouldGet('tokenizer', $responseProfile)) {
         $this->tokenizer = $this->transformTokenizer($sourceObject);
     }
 }
Пример #24
0
 public function doFromObject($dbObject, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($dbObject, $responseProfile);
     if (!$dbObject instanceof accessControl) {
         return;
     }
     if ($this->shouldGet('restrictions', $responseProfile)) {
         $rules = $dbObject->getRulesArray();
         foreach ($rules as $rule) {
             if (!$rule instanceof kAccessControlRestriction) {
                 KalturaLog::info("Access control [" . $dbObject->getId() . "] rules are new and cannot be loaded using old object");
                 $this->containsUnsuportedRestrictions = true;
                 return;
             }
         }
         $this->restrictions = KalturaRestrictionArray::fromDbArray($rules);
     }
 }
Пример #25
0
 public function doFromObject($dbCuePoint, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($dbCuePoint, $responseProfile);
     if ($this->shouldGet('userId', $responseProfile)) {
         if ($dbCuePoint->getKuserId() !== null) {
             $dbKuser = kuserPeer::retrieveByPK($dbCuePoint->getKuserId());
             if ($dbKuser) {
                 if (!kConf::hasParam('protect_userid_in_api') || !in_array($dbCuePoint->getPartnerId(), kConf::get('protect_userid_in_api')) || !in_array(kCurrentContext::getCurrentSessionType(), array(kSessionBase::SESSION_TYPE_NONE, kSessionBase::SESSION_TYPE_WIDGET))) {
                     $this->userId = $dbKuser->getPuserId();
                 }
             }
         }
     }
 }
 public function doFromObject($source_object, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($source_object, $responseProfile);
     if ($this->shouldGet('mrssTransformer', $responseProfile)) {
         $key = $source_object->getSyncKey(GenericDistributionProviderAction::FILE_SYNC_DISTRIBUTION_PROVIDER_ACTION_MRSS_TRANSFORMER);
         $this->mrssTransformer = kFileSyncUtils::file_get_contents($key, true, false);
     }
     if ($this->shouldGet('mrssValidator', $responseProfile)) {
         $key = $source_object->getSyncKey(GenericDistributionProviderAction::FILE_SYNC_DISTRIBUTION_PROVIDER_ACTION_MRSS_VALIDATOR);
         $this->mrssValidator = kFileSyncUtils::file_get_contents($key, true, false);
     }
     if ($this->shouldGet('resultsTransformer', $responseProfile)) {
         $key = $source_object->getSyncKey(GenericDistributionProviderAction::FILE_SYNC_DISTRIBUTION_PROVIDER_ACTION_RESULTS_TRANSFORMER);
         $this->resultsTransformer = kFileSyncUtils::file_get_contents($key, true, false);
     }
 }
Пример #27
0
 public function doFromObject($sourceObject, KalturaDetachedResponseProfile $responseProfile = null)
 {
     if (!$sourceObject) {
         return;
     }
     parent::doFromObject($sourceObject, $responseProfile);
     if ($this->shouldGet('validationErrors', $responseProfile)) {
         $this->validationErrors = KalturaDistributionValidationErrorArray::fromDbArray($sourceObject->getValidationErrors());
     }
     if ($this->shouldGet('hasSubmitResultsLog', $responseProfile)) {
         $this->hasSubmitResultsLog = (bool) $sourceObject->getSubmitResultsVersion();
     }
     if ($this->shouldGet('hasSubmitSentDataLog', $responseProfile)) {
         $this->hasSubmitSentDataLog = (bool) $sourceObject->getSubmitDataVersion();
     }
     if ($this->shouldGet('hasUpdateResultsLog', $responseProfile)) {
         $this->hasUpdateResultsLog = (bool) $sourceObject->getUpdateResultsVersion();
     }
     if ($this->shouldGet('hasUpdateSentDataLog', $responseProfile)) {
         $this->hasUpdateSentDataLog = (bool) $sourceObject->getUpdateDataVersion();
     }
     if ($this->shouldGet('hasDeleteResultsLog', $responseProfile)) {
         $this->hasDeleteResultsLog = (bool) $sourceObject->getDeleteResultsVersion();
     }
     if ($this->shouldGet('hasDeleteSentDataLog', $responseProfile)) {
         $this->hasDeleteSentDataLog = (bool) $sourceObject->getDeleteDataVersion();
     }
 }
 public function doFromObject($source_object, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($source_object, $responseProfile);
     $permissions = PermissionPeer::retrievePartnerLevelPermissions($source_object->getId());
     $this->permissions = KalturaPermissionArray::fromDbArray($permissions);
     $this->limits = KalturaSystemPartnerLimitArray::fromPartner($source_object);
     $this->restrictEntryByMetadata = $source_object->getShouldApplyAccessControlOnEntryMetadata();
     $dbAutoModerationEntryFilter = $source_object->getAutoModerateEntryFilter();
     if ($dbAutoModerationEntryFilter) {
         $this->autoModerateEntryFilter = new KalturaBaseEntryFilter();
         $this->autoModerateEntryFilter->fromObject($dbAutoModerationEntryFilter);
     }
     $this->partnerName = kString::stripUtf8InvalidChars($this->partnerName);
     $this->description = kString::stripUtf8InvalidChars($this->description);
     $this->adminName = kString::stripUtf8InvalidChars($this->adminName);
     if ($this->deliveryProfileIds) {
         $this->deliveryProfileIds = json_encode($this->deliveryProfileIds);
     }
 }
Пример #29
0
 public function doFromObject($sourceObject, KalturaDetachedResponseProfile $responseProfile = null)
 {
     if (!$sourceObject) {
         return;
     }
     entryPeer::addValidatedEntry($sourceObject->getId());
     parent::doFromObject($sourceObject, $responseProfile);
     $partnerId = kCurrentContext::$ks_partner_id ? kCurrentContext::$ks_partner_id : kCurrentContext::$partner_id;
     if (implode(',', kEntitlementUtils::getKsPrivacyContext()) != kEntitlementUtils::DEFAULT_CONTEXT . $partnerId) {
         $this->categories = null;
         $this->categoriesIds = null;
     }
     if (!kConf::hasParam('protect_userid_in_api') || !in_array($sourceObject->getPartnerId(), kConf::get('protect_userid_in_api')) || !in_array(kCurrentContext::getCurrentSessionType(), array(kSessionBase::SESSION_TYPE_NONE, kSessionBase::SESSION_TYPE_WIDGET))) {
         if ($this->shouldGet('userId', $responseProfile)) {
             $this->userId = $sourceObject->getPuserId();
         }
         if ($this->shouldGet('creatorId', $responseProfile)) {
             $this->creatorId = $sourceObject->getCreatorPuserId();
         }
     }
 }
Пример #30
0
 public function doFromObject($source_object, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($source_object, $responseProfile);
     if ($this->shouldGet('fileHandlerConfig', $responseProfile)) {
         $dbFileHandlerConfig = $source_object->getFileHandlerConfig();
         if ($dbFileHandlerConfig) {
             $apiFileHandlerConfig = KalturaPluginManager::loadObject('KalturaDropFolderFileHandlerConfig', $source_object->getFileHandlerType());
             if ($apiFileHandlerConfig) {
                 $apiFileHandlerConfig->fromObject($dbFileHandlerConfig);
                 $this->fileHandlerConfig = $apiFileHandlerConfig;
             } else {
                 KalturaLog::err("Cannot load API object for core file handler config type [" . $dbFileHandlerConfig->getHandlerType() . "]");
             }
         }
     }
 }