本文整理汇总了PHP中Partner::getKmcVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP Partner::getKmcVersion方法的具体用法?PHP Partner::getKmcVersion怎么用?PHP Partner::getKmcVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Partner
的用法示例。
在下文中一共展示了Partner::getKmcVersion方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: constructJobData
/**
* Function constructs a core object of type kBulkUploadJobData
* @param int $conversionProfileId
* @param string $filePath
* @param string $userId
* @param int $bulkUploadType
* @param string $uploadedBy
* @param string $fileName
* @throws KalturaErrors::CONVERSION_PROFILE_ID_NOT_FOUND
*/
protected function constructJobData($filePath, $fileName, Partner $partner, $puserId, $uploadedBy, $conversionProfileId = null, $coreBulkUploadType = null)
{
$data = KalturaPluginManager::loadObject('kBulkUploadJobData', $coreBulkUploadType);
if (is_null($data)) {
throw new KalturaAPIException(KalturaErrors::BULK_UPLOAD_BULK_UPLOAD_TYPE_NOT_VALID, $coreBulkUploadType);
}
$data->setFilePath($filePath);
$data->setUserId($puserId);
$data->setUploadedBy($uploadedBy);
$data->setFileName($fileName);
if (!$conversionProfileId) {
$conversionProfileId = $partner->getDefaultConversionProfileId();
}
$kmcVersion = $partner->getKmcVersion();
$check = null;
if ($kmcVersion < 2) {
$check = ConversionProfilePeer::retrieveByPK($conversionProfileId);
} else {
$check = conversionProfile2Peer::retrieveByPK($conversionProfileId);
}
if (!$check) {
throw new KalturaAPIException(KalturaErrors::CONVERSION_PROFILE_ID_NOT_FOUND, $conversionProfileId);
}
$objectData = new kBulkUploadEntryData();
$objectData->setConversionProfileId($conversionProfileId);
$data->setObjectData($objectData);
return $data;
}
示例2: redirectPartnerToCorrectKmc
public static function redirectPartnerToCorrectKmc(Partner $partner, $ks, $uid = null, $screenName = null, $email = null, $validatingKmc)
{
if ($validatingKmc == $partner->getKmcVersion()) {
return true;
}
$subpId = $partner->getId() * 100;
switch ($partner->getKmcVersion()) {
case 1:
$kmc1 = "/index.php/kmc/kmc1?partner_id=" . $partner->getId() . "&subp_id=" . $subpId . "&ks=" . $ks . "&uid=" . $uid . "&screen_name=" . $screenName . "&email=" . $email;
header("Location: " . $kmc1);
die;
break;
case 2:
case 3:
case 4:
default:
$ver = $partner->getKmcVersion();
$kmc_url = "/index.php/kmc/kmc{$ver}";
header("Location: " . $kmc_url);
die;
break;
}
}
示例3: addBulkUploadJob
/**
* Function adds bulk upload job to the queue
* @param Partner $partner
* @param kBulkUploadJobData $jobData
* @param string $bulkUploadType
* @throws APIException
* @return BatchJob
*/
public static function addBulkUploadJob(Partner $partner, kBulkUploadJobData $jobData, $bulkUploadType = null, $objectId = null, $objectType = null)
{
KalturaLog::debug("adding BulkUpload job");
$job = new BatchJob();
$job->setPartnerId($partner->getId());
$job->setJobType(BatchJobType::BULKUPLOAD);
$job->setJobSubType($bulkUploadType);
if (!is_null($objectId) && !is_null($objectType)) {
$job->setObjectId($objectId);
$job->setObjectType($objectType);
}
if (is_null($jobData)) {
throw new APIException(APIErrors::BULK_UPLOAD_BULK_UPLOAD_TYPE_NOT_VALID, $bulkUploadType);
}
$job->setStatus(BatchJob::BATCHJOB_STATUS_DONT_PROCESS);
$job = kJobsManager::addJob($job, $jobData, BatchJobType::BULKUPLOAD, $bulkUploadType);
if (!is_null($jobData->getFilePath())) {
$syncKey = $job->getSyncKey(BatchJob::FILE_SYNC_BATCHJOB_SUB_TYPE_BULKUPLOAD);
// kFileSyncUtils::file_put_contents($syncKey, file_get_contents($csvFileData["tmp_name"]));
try {
kFileSyncUtils::moveFromFile($jobData->getFilePath(), $syncKey, true);
} catch (Exception $e) {
KalturaLog::err($e);
throw new APIException(APIErrors::BULK_UPLOAD_CREATE_CSV_FILE_SYNC_ERROR);
}
$filePath = kFileSyncUtils::getLocalFilePathForKey($syncKey);
$jobData->setFilePath($filePath);
}
if (!$jobData->getBulkUploadObjectType()) {
$jobData->setBulkUploadObjectType(BulkUploadObjectType::ENTRY);
}
if ($jobData->getBulkUploadObjectType() == BulkUploadObjectType::ENTRY && !$jobData->getObjectData()->getConversionProfileId()) {
$jobData->setConversionProfileId($partner->getDefaultConversionProfileId());
$kmcVersion = $partner->getKmcVersion();
$check = null;
if ($kmcVersion < 2) {
$check = ConversionProfilePeer::retrieveByPK($jobData->getConversionProfileId());
} else {
$check = conversionProfile2Peer::retrieveByPK($jobData->getConversionProfileId());
}
if (!$check) {
throw new APIException(APIErrors::CONVERSION_PROFILE_ID_NOT_FOUND, $jobData->getConversionProfileId());
}
}
$job->setData($jobData);
return kJobsManager::updateBatchJob($job, BatchJob::BATCHJOB_STATUS_PENDING);
}