本文整理汇总了PHP中KalturaPluginManager::loadObject方法的典型用法代码示例。如果您正苦于以下问题:PHP KalturaPluginManager::loadObject方法的具体用法?PHP KalturaPluginManager::loadObject怎么用?PHP KalturaPluginManager::loadObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KalturaPluginManager
的用法示例。
在下文中一共展示了KalturaPluginManager::loadObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addXMLBulkUploadJob
/**
* Add bulk upload job
* @param DropFolder $folder
* @param DropFolderFile $leadDropFolderFile
* @throws Exception
*/
private function addXMLBulkUploadJob(DropFolder $folder, DropFolderFile $leadDropFolderFile)
{
/* @var $leadDropFolderFile FeedDropFolderFile */
KalturaLog::info('Adding BulkUpload job');
try {
$coreBulkUploadType = BulkUploadXmlPlugin::getBulkUploadTypeCoreValue(BulkUploadXmlType::XML);
$objectId = $leadDropFolderFile->getId();
$objectType = DropFolderXmlBulkUploadPlugin::getBatchJobObjectTypeCoreValue(DropFolderBatchJobObjectType::DROP_FOLDER_FILE);
$partner = PartnerPeer::retrieveByPK($folder->getPartnerId());
$data = KalturaPluginManager::loadObject('kBulkUploadJobData', $coreBulkUploadType);
/* @var $data kBulkUploadJobData */
$data->setUploadedBy(kDropFolderXmlEventsConsumer::UPLOADED_BY);
KalturaLog::info("Feed XML path: " . $leadDropFolderFile->getFeedXmlPath());
$data->setFilePath($leadDropFolderFile->getFeedXmlPath());
$data->setFileName(basename($data->getFilePath()) . '.xml');
$objectData = new kBulkUploadEntryData();
KalturaLog::info('Conversion profile id: ' . $folder->getConversionProfileId());
$objectData->setConversionProfileId($folder->getConversionProfileId());
$data->setObjectData($objectData);
$job = kJobsManager::addBulkUploadJob($partner, $data, $coreBulkUploadType, $objectId, $objectType);
$this->setFileToProcessing($leadDropFolderFile);
return $job;
} catch (Exception $e) {
KalturaLog::err("Error adding BulkUpload job -" . $e->getMessage());
throw new Exception(DropFolderXmlBulkUploadPlugin::ERROR_ADDING_BULK_UPLOAD_MESSAGE, DropFolderXmlBulkUploadPlugin::getErrorCodeCoreValue(DropFolderXmlBulkUploadErrorCode::ERROR_ADDING_BULK_UPLOAD));
}
}
示例2: fromObject
public function fromObject($dbData)
{
/* @var $dbData kCopyJobData */
$filter = $dbData->getFilter();
$filterType = get_class($filter);
switch ($filterType) {
case 'entryFilter':
$this->filter = new KalturaBaseEntryFilter();
$this->templateObject = new KalturaBaseEntry();
break;
case 'categoryFilter':
$this->filter = new KalturaCategoryFilter();
$this->templateObject = new KalturaCategory();
break;
case 'categoryEntryFilter':
$this->filter = new KalturaCategoryEntryFilter();
$this->templateObject = new KalturaCategoryEntry();
break;
case 'categoryKuserFilter':
$this->filter = new KalturaCategoryUserFilter();
$this->templateObject = new KalturaCategoryUser();
break;
default:
$this->filter = KalturaPluginManager::loadObject('KalturaFilter', $filterType);
}
if ($this->filter) {
$this->filter->fromObject($filter);
}
if ($this->templateObject) {
$this->templateObject->fromObject($dbData->getTemplateObject());
}
return parent::fromObject($dbData);
}
示例3: createNewEngine
/**
* @param int $type
* @param KSchedularTaskConfig $taskConfig
* @param KalturaConvartableJobData $data
* @return KOperationEngine
*/
protected static function createNewEngine($type, KSchedularTaskConfig $taskConfig, KalturaConvartableJobData $data)
{
// TODO - remove after old version deprecated
if (!$data->flavorParamsOutput->engineVersion) {
return new KOperationEngineOldVersionWrapper($type, $taskConfig, $data);
}
switch ($type) {
case KalturaConversionEngineType::MENCODER:
return new KOperationEngineMencoder($taskConfig->params->mencderCmd, $data->destFileSyncLocalPath);
case KalturaConversionEngineType::ON2:
return new KOperationEngineFlix($taskConfig->params->on2Cmd, $data->destFileSyncLocalPath);
case KalturaConversionEngineType::FFMPEG:
return new KOperationEngineFfmpeg($taskConfig->params->ffmpegCmd, $data->destFileSyncLocalPath);
case KalturaConversionEngineType::FFMPEG_AUX:
return new KOperationEngineFfmpegAux($taskConfig->params->ffmpegAuxCmd, $data->destFileSyncLocalPath);
case KalturaConversionEngineType::FFMPEG_VP8:
return new KOperationEngineFfmpegVp8($taskConfig->params->ffmpegVp8Cmd, $data->destFileSyncLocalPath);
case KalturaConversionEngineType::ENCODING_COM:
return new KOperationEngineEncodingCom($taskConfig->params->EncodingComUserId, $taskConfig->params->EncodingComUserKey, $taskConfig->params->EncodingComUrl);
}
if ($data instanceof KalturaConvertCollectionJobData) {
$engine = self::getCollectionEngine($type, $taskConfig, $data);
if ($engine) {
return $engine;
}
}
$engine = KalturaPluginManager::loadObject('KOperationEngine', $type, array('params' => $taskConfig->params, 'outFilePath' => $data->destFileSyncLocalPath));
return $engine;
}
示例4: getInstanceByDbObject
static function getInstanceByDbObject(kCondition $dbObject)
{
switch ($dbObject->getType()) {
case ConditionType::AUTHENTICATED:
return new KalturaAuthenticatedCondition();
case ConditionType::COUNTRY:
return new KalturaCountryCondition();
case ConditionType::IP_ADDRESS:
return new KalturaIpAddressCondition();
case ConditionType::SITE:
return new KalturaSiteCondition();
case ConditionType::USER_AGENT:
return new KalturaUserAgentCondition();
case ConditionType::FIELD_COMPARE:
return new KalturaFieldCompareCondition();
case ConditionType::FIELD_MATCH:
return new KalturaFieldMatchCondition();
case ConditionType::ASSET_PROPERTIES_COMPARE:
return new KalturaAssetPropertiesCompareCondition();
case ConditionType::USER_ROLE:
return new KalturaUserRoleCondition();
case ConditionType::GEO_DISTANCE:
return new KalturaGeoDistanceCondition();
case ConditionType::OR_OPERATOR:
return new KalturaOrCondition();
case ConditionType::HASH:
return new KalturaHashCondition();
case ConditionType::DELIVERY_PROFILE:
return new KalturaDeliveryProfileCondition();
case ConditionType::ACTIVE_EDGE_VALIDATE:
return new KalturaValidateActiveEdgeCondition();
default:
return KalturaPluginManager::loadObject('KalturaCondition', $dbObject->getType());
}
}
示例5: getInstanceByClass
/**
* @param string $class class name of the core object
* @return KalturaEventCondition
*/
public static function getInstanceByClass($class)
{
if ($class == kEventFieldCondition) {
return new KalturaEventFieldCondition();
}
return KalturaPluginManager::loadObject('KalturaEventCondition', $class);
}
示例6: getGeoCoder
/**
* @param int $type of enum geoCoderType
* @return kGeoCoder
*/
public static function getGeoCoder($type = null)
{
if (!$type || $type == geoCoderType::KALTURA) {
return new myIPGeocoder();
}
return KalturaPluginManager::loadObject('kGeoCoder', $type);
}
示例7: doFromObject
public function doFromObject($dbObject, KalturaDetachedResponseProfile $responseProfile = null)
{
/* @var $dbObject kHttpNotificationDataText */
parent::doFromObject($dbObject, $responseProfile);
if ($this->shouldGet('content', $responseProfile)) {
$contentType = get_class($dbObject->getContent());
KalturaLog::debug("Loading KalturaStringValue from type [{$contentType}]");
switch ($contentType) {
case 'kStringValue':
$this->content = new KalturaStringValue();
break;
case 'kEvalStringField':
$this->content = new KalturaEvalStringField();
break;
default:
$this->content = KalturaPluginManager::loadObject('KalturaStringValue', $contentType);
break;
}
if ($this->content) {
$this->content->fromObject($dbObject->getContent());
}
}
if ($this->shouldGet('data', $responseProfile)) {
$this->data = $dbObject->getData();
}
}
示例8: doFromObject
public function doFromObject($dbObject, KalturaDetachedResponseProfile $responseProfile = null)
{
parent::doFromObject($dbObject, $responseProfile);
/* @var $dbObject kEmailNotificationCategoryRecipientProvider */
$categoryIdFieldType = get_class($dbObject->getCategoryId());
KalturaLog::info("Retrieving API object for categoryId fild of type [{$categoryIdFieldType}]");
switch ($categoryIdFieldType) {
case 'kObjectIdField':
$this->categoryId = new KalturaObjectIdField();
break;
case 'kEvalStringField':
$this->categoryId = new KalturaEvalStringField();
break;
case 'kStringValue':
$this->categoryId = new KalturaStringValue();
break;
default:
$this->categoryId = KalturaPluginManager::loadObject('KalturaStringValue', $categoryIdFieldType);
break;
}
if ($this->categoryId) {
$this->categoryId->fromObject($dbObject->getCategoryId());
}
if ($dbObject->getCategoryUserFilter()) {
$this->categoryUserFilter = new KalturaCategoryUserProviderFilter();
$this->categoryUserFilter->fromObject($dbObject->getCategoryUserFilter());
}
}
示例9: 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;
}
示例10: doFromObject
public function doFromObject($dbData, KalturaDetachedResponseProfile $responseProfile = null)
{
/* @var $dbData kIndexJobData */
$filter = $dbData->getFilter();
$filterType = get_class($filter);
switch ($filterType) {
case 'entryFilter':
$this->filter = new KalturaBaseEntryFilter();
break;
case 'categoryFilter':
$this->filter = new KalturaCategoryFilter();
break;
case 'categoryEntryFilter':
$this->filter = new KalturaCategoryEntryFilter();
break;
case 'categoryKuserFilter':
$this->filter = new KalturaCategoryUserFilter();
break;
case 'kuserFilter':
$this->filter = new KalturaUserFilter();
break;
default:
$this->filter = KalturaPluginManager::loadObject('KalturaFilter', $filterType);
}
if ($this->filter) {
$this->filter->fromObject($filter);
}
parent::doFromObject($dbData, $responseProfile);
}
示例11: getInstanceByType
/**
* @param int $type
* @param bool $isAdmin
* @return KalturaBaseEntry
*/
static function getInstanceByType($type, $isAdmin = false)
{
switch ($type) {
case KalturaEntryType::MEDIA_CLIP:
$obj = new KalturaMediaEntry();
break;
case KalturaEntryType::MIX:
$obj = new KalturaMixEntry();
break;
case KalturaEntryType::PLAYLIST:
$obj = new KalturaPlaylist();
break;
case KalturaEntryType::DATA:
$obj = new KalturaDataEntry();
break;
case KalturaEntryType::LIVE_STREAM:
if ($isAdmin) {
$obj = new KalturaLiveStreamAdminEntry();
} else {
$obj = new KalturaLiveStreamEntry();
}
break;
case KalturaEntryType::LIVE_CHANNEL:
$obj = new KalturaLiveChannel();
break;
default:
$obj = KalturaPluginManager::loadObject('KalturaBaseEntry', $type);
if (!$obj) {
$obj = new KalturaBaseEntry();
}
break;
}
return $obj;
}
示例12: fromDbArray
public static function fromDbArray($arr, KalturaDetachedResponseProfile $responseProfile = null)
{
$newArr = new KalturaEventNotificationParameterArray();
if ($arr == null) {
return $newArr;
}
foreach ($arr as $obj) {
$parameterType = get_class($obj);
switch ($parameterType) {
case 'kEventNotificationParameter':
$nObj = new KalturaEventNotificationParameter();
break;
case 'kEventNotificationArrayParameter':
$nObj = new KalturaEventNotificationArrayParameter();
break;
default:
$nObj = KalturaPluginManager::loadObject('KalturaEventNotificationParameter', $parameterType);
}
if ($nObj) {
$nObj->fromObject($obj, $responseProfile);
$newArr[] = $nObj;
}
}
return $newArr;
}
示例13: getInstanceByType
/**
* Function returns KalturaUserEntry sub-type according to protocol
* @var string $type
* @return KalturaUserEntry
*
*/
public static function getInstanceByType($type)
{
$obj = KalturaPluginManager::loadObject("KalturaUserEntry", $type);
if (is_null($obj)) {
KalturaLog::err("The type '{$type}' is unknown");
}
return $obj;
}
示例14: getInstanceByType
/**
* @param int $type
* @return KalturaDrmDevice
*/
static function getInstanceByType($provider)
{
$obj = KalturaPluginManager::loadObject('KalturaDrmDevice', $provider);
if (!$obj) {
$obj = new KalturaDrmDevice();
}
return $obj;
}
示例15: getInstance
/**
* @param int $objectType of enum KalturaRecalculateCacheType
* @return KRecalculateCacheEngine
*/
public static function getInstance($objectType)
{
switch ($objectType) {
case KalturaRecalculateCacheType::RESPONSE_PROFILE:
return new KRecalculateResponseProfileCacheEngine();
default:
return KalturaPluginManager::loadObject('KRecalculateCacheEngine', $objectType);
}
}