本文整理汇总了PHP中KalturaPluginManager::getObjectClass方法的典型用法代码示例。如果您正苦于以下问题:PHP KalturaPluginManager::getObjectClass方法的具体用法?PHP KalturaPluginManager::getObjectClass怎么用?PHP KalturaPluginManager::getObjectClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KalturaPluginManager
的用法示例。
在下文中一共展示了KalturaPluginManager::getObjectClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOMClass
/**
* The returned Class will contain objects of the default type or
* objects that inherit from the default.
*
* @param array $row PropelPDO result row.
* @param int $colnum Column to examine for OM class information (first is 0).
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getOMClass($row, $colnum)
{
if ($row) {
$typeField = self::translateFieldName(DrmKeyPeer::PROVIDER, BasePeer::TYPE_COLNAME, BasePeer::TYPE_NUM);
$drmKeyType = $row[$typeField];
$extendedCls = KalturaPluginManager::getObjectClass(parent::OM_CLASS, $drmKeyType);
if ($extendedCls) {
return $extendedCls;
}
}
return parent::OM_CLASS;
}
示例2: getClassByDeliveryProfileType
/**
* Returns the matching delivery profile class by the delivery profile type.
* @param DeliveryProfileType $deliveryType
* @return string representing the delivery object class
*/
public static function getClassByDeliveryProfileType($deliveryType)
{
if (isset(self::$class_types_cache[$deliveryType])) {
return self::$class_types_cache[$deliveryType];
}
$extendedCls = KalturaPluginManager::getObjectClass(parent::OM_CLASS, $deliveryType);
if ($extendedCls) {
self::$class_types_cache[$deliveryType] = $extendedCls;
return $extendedCls;
}
self::$class_types_cache[$deliveryType] = parent::OM_CLASS;
return parent::OM_CLASS;
}
示例3: getOMClass
public static function getOMClass($row, $colnum)
{
if ($row) {
$typeField = self::translateFieldName(BusinessProcessServerPeer::TYPE, BasePeer::TYPE_COLNAME, BasePeer::TYPE_NUM);
$type = $row[$typeField];
if (isset(self::$class_types_cache[$type])) {
return self::$class_types_cache[$type];
}
$extendedCls = KalturaPluginManager::getObjectClass('BusinessProcessServer', $type);
if ($extendedCls) {
self::$class_types_cache[$type] = $extendedCls;
return $extendedCls;
}
}
return null;
}
示例4: getOMClass
public static function getOMClass($row, $colnum)
{
if ($row) {
$colnum += self::translateFieldName(self::TYPE, BasePeer::TYPE_COLNAME, BasePeer::TYPE_NUM);
$assetType = $row[$colnum];
if (isset(self::$class_types_cache[$assetType])) {
return self::$class_types_cache[$assetType];
}
$extendedCls = KalturaPluginManager::getObjectClass(self::OM_CLASS, $assetType);
if ($extendedCls) {
self::$class_types_cache[$assetType] = $extendedCls;
return $extendedCls;
}
}
throw new Exception("Can't instantiate un-typed cue point [" . print_r($row, true) . "]");
}
示例5: getOMClass
public static function getOMClass($row, $colnum)
{
$serverNodeType = null;
if ($row) {
$typeField = self::translateFieldName(self::TYPE, BasePeer::TYPE_COLNAME, BasePeer::TYPE_NUM);
$serverNodeType = $row[$typeField];
if (isset(self::$class_types_cache[$serverNodeType])) {
return self::$class_types_cache[$serverNodeType];
}
$extendedCls = KalturaPluginManager::getObjectClass(parent::OM_CLASS, $serverNodeType);
if ($extendedCls) {
self::$class_types_cache[$serverNodeType] = $extendedCls;
return $extendedCls;
}
}
throw new Exception("Can't instantiate un-typed [{$serverNodeType}] remoteServer [" . print_r($row, true) . "]");
}
示例6: getOMClass
/**
* The returned Class will contain objects of the default type or
* objects that inherit from the default.
*
* @param array $row PropelPDO result row.
* @param int $colnum Column to examine for OM class information (first is 0).
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getOMClass($row, $colnum)
{
if ($row) {
$protocolField = self::translateFieldName(StorageProfilePeer::PROTOCOL, BasePeer::TYPE_COLNAME, BasePeer::TYPE_NUM);
$storageProfileProtocol = $row[$protocolField];
if (isset(self::$class_types_cache[$storageProfileProtocol])) {
return self::$class_types_cache[$storageProfileProtocol];
}
$extendedCls = KalturaPluginManager::getObjectClass(parent::OM_CLASS, $storageProfileProtocol);
if ($extendedCls) {
self::$class_types_cache[$storageProfileProtocol] = $extendedCls;
return $extendedCls;
}
self::$class_types_cache[$storageProfileProtocol] = parent::OM_CLASS;
}
return parent::OM_CLASS;
}
示例7: getOMClassImpl
private static function getOMClassImpl($row, $colnum)
{
if ($row) {
$assetType = $row[$colnum + 4];
// provider type column
if (isset(self::$class_types_cache[$assetType])) {
return self::$class_types_cache[$assetType];
}
$extendedCls = KalturaPluginManager::getObjectClass(parent::OM_CLASS, $assetType);
if ($extendedCls) {
self::$class_types_cache[$assetType] = $extendedCls;
return $extendedCls;
}
self::$class_types_cache[$assetType] = GenericDistributionProfilePeer::OM_CLASS;
}
return GenericDistributionProfilePeer::OM_CLASS;
}
示例8: getOMClass
public static function getOMClass($row, $colnum)
{
$type = null;
if ($row) {
$typeField = self::translateFieldName(EventNotificationTemplatePeer::TYPE, BasePeer::TYPE_COLNAME, BasePeer::TYPE_NUM);
$type = $row[$typeField];
if (isset(self::$class_types_cache[$type])) {
return self::$class_types_cache[$type];
}
$extendedCls = KalturaPluginManager::getObjectClass('EventNotificationTemplate', $type);
if ($extendedCls) {
self::$class_types_cache[$type] = $extendedCls;
return $extendedCls;
}
}
throw new kCoreException("Event notification template type [{$type}] not found", kCoreException::OBJECT_TYPE_NOT_FOUND, $type);
}
示例9: getOMClass
/**
* The returned Class will contain objects of the default type or
* objects that inherit from the default.
*
* @param array $row PropelPDO result row.
* @param int $colnum Column to examine for OM class information (first is 0).
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getOMClass($row, $colnum)
{
if ($row) {
$assetType = $row[$colnum + 21];
// type column
if (isset(self::$class_types_cache[$assetType])) {
return self::$class_types_cache[$assetType];
}
$extendedCls = KalturaPluginManager::getObjectClass(parent::OM_CLASS, $assetType);
if ($extendedCls) {
self::$class_types_cache[$assetType] = $extendedCls;
return $extendedCls;
}
self::$class_types_cache[$assetType] = parent::OM_CLASS;
}
return parent::OM_CLASS;
}
示例10: getOMClass
public static function getOMClass($row, $colnum)
{
if ($row) {
$colnum += self::translateFieldName(self::TYPE, BasePeer::TYPE_COLNAME, BasePeer::TYPE_NUM);
$assetType = $row[$colnum];
if (isset(self::$class_types_cache[$assetType])) {
return self::$class_types_cache[$assetType];
}
$extendedCls = KalturaPluginManager::getObjectClass(self::OM_CLASS, $assetType);
if ($extendedCls) {
self::$class_types_cache[$assetType] = $extendedCls;
return $extendedCls;
}
self::$class_types_cache[$assetType] = self::OM_CLASS;
}
return self::OM_CLASS;
}
示例11: toObject
public function toObject($objectToFill = null, $propsToSkip = array())
{
if (is_null($objectToFill)) {
$objectToFill = new kEventNotificationScope();
}
/** @var kEventNotificationScope $objectToFill */
$objectToFill = parent::toObject($objectToFill);
$objectClassName = KalturaPluginManager::getObjectClass('EventNotificationEventObjectType', kPluginableEnumsManager::apiToCore('EventNotificationEventObjectType', $this->scopeObjectType));
$peerClass = $objectClassName . 'Peer';
$objectId = $this->objectId;
if (class_exists($peerClass)) {
$objectToFill->setObject($peerClass::retrieveByPk($objectId));
} else {
$b = new $objectClassName();
$peer = $b->getPeer();
$object = $peer::retrieveByPK($objectId);
$objectToFill->setObject($object);
}
if (is_null($objectToFill->getObject())) {
throw new KalturaAPIException(KalturaErrors::INVALID_OBJECT_ID, $this->objectId);
}
return $objectToFill;
}
示例12: getObjectTypeName
/**
* @param KalturaMetadataObjectType $objectType
*
* @return string
*/
public static function getObjectTypeName($objectType)
{
if (isset(self::$objectTypeNames[$objectType])) {
return self::$objectTypeNames[$objectType];
}
return KalturaPluginManager::getObjectClass('IMetadataObject', $objectType);
}
示例13: doAction
public function doAction(Zend_Controller_Action $action)
{
$action->getHelper('layout')->disableLayout();
$this->client = Kaltura_ClientHelper::getClient();
$request = $action->getRequest();
$profileId = $this->_getParam('profile_id');
$providerType = null;
$partnerId = null;
$distributionProfile = null;
$action->view->errMessage = null;
$action->view->form = '';
try {
if ($profileId) {
$distributionProfile = $this->client->distributionProfile->get($profileId);
$providerType = $distributionProfile->providerType;
$partnerId = $distributionProfile->partnerId;
} else {
$providerType = $this->_getParam('provider_type');
$partnerId = $this->_getParam('partner_id');
}
$form = null;
$profileClass = 'KalturaDistributionProfile';
if ($providerType == KalturaDistributionProviderType::GENERIC) {
$form = new Form_GenericProviderProfileConfiguration($partnerId, $providerType);
$profileClass = 'KalturaGenericDistributionProfile';
} elseif ($providerType == KalturaDistributionProviderType::SYNDICATION) {
$form = new Form_SyndicationProviderProfileConfiguration($partnerId, $providerType);
$profileClass = 'KalturaSyndicationDistributionProfile';
} else {
$form = KalturaPluginManager::loadObject('Form_ProviderProfileConfiguration', $providerType, array($partnerId, $providerType));
$profileClass = KalturaPluginManager::getObjectClass('KalturaDistributionProfile', $providerType);
}
if (!$form) {
$action->view->errMessage = "Profile form not found for provider [{$providerType}]";
return;
}
$form->setAction($action->view->url(array('controller' => 'plugin', 'action' => 'DistributionProfileConfigureAction')));
$pager = new KalturaFilterPager();
$pager->pageSize = 100;
$flavorParamsResponse = $this->client->flavorParams->listAction(null, $pager);
if ($profileId) {
if ($request->isPost()) {
$form->populate($request->getPost());
$distributionProfile = $form->getObject($profileClass, $request->getPost());
$form->resetUnUpdatebleAttributes($distributionProfile);
$distributionProfile = $this->client->distributionProfile->update($profileId, $distributionProfile);
$form->saveProviderAdditionalObjects($distributionProfile);
$form->setAttrib('class', 'valid');
} else {
$form->populateFromObject($distributionProfile);
$optionalFlavorParamsIds = array();
$requiredFlavorParamsIds = array();
if (!is_null($distributionProfile->optionalFlavorParamsIds) && strlen($distributionProfile->optionalFlavorParamsIds)) {
$optionalFlavorParamsIds = explode(',', $distributionProfile->optionalFlavorParamsIds);
}
if (!is_null($distributionProfile->requiredFlavorParamsIds) && strlen($distributionProfile->requiredFlavorParamsIds)) {
$requiredFlavorParamsIds = explode(',', $distributionProfile->requiredFlavorParamsIds);
}
$form->addFlavorParamsFields($flavorParamsResponse, $optionalFlavorParamsIds, $requiredFlavorParamsIds);
foreach ($distributionProfile->requiredThumbDimensions as $dimensions) {
$form->addThumbDimensions($dimensions, true);
}
foreach ($distributionProfile->optionalThumbDimensions as $dimensions) {
$form->addThumbDimensions($dimensions, false);
}
$form->addThumbDimensionsForm();
}
$action->view->form = $form;
} else {
if ($request->isPost()) {
$form->populate($request->getPost());
$distributionProfile = $form->getObject($profileClass, $request->getPost());
if (!$distributionProfile->partnerId) {
$distributionProfile->partnerId = 0;
}
Kaltura_ClientHelper::impersonate($distributionProfile->partnerId);
$distributionProfile->partnerId = null;
$distributionProfile = $this->client->distributionProfile->add($distributionProfile);
Kaltura_ClientHelper::unimpersonate();
$form->saveProviderAdditionalObjects($distributionProfile);
$form->setAttrib('class', 'valid');
} else {
$form->addFlavorParamsFields($flavorParamsResponse);
$form->addThumbDimensionsForm();
}
$action->view->form = $form;
}
} catch (Exception $e) {
KalturaLog::err($e->getMessage() . "\n" . $e->getTraceAsString());
$action->view->errMessage = $e->getMessage();
}
}
示例14: editTemplateFields
/**
* Function sweeps the given fields of the emailNotificationTemplate, and parses expressions of the type
* {metadata:[metadataProfileSystemName]:[metadataProfileFieldSystemName]}
*/
public static function editTemplateFields($sweepFieldValues, $scope, $objectType)
{
KalturaLog::debug('Field values to sweep: ' . print_r($sweepFieldValues, true));
if (!$scope instanceof kEventScope) {
return array();
}
if (!method_exists($scope->getObject(), 'getPartnerId')) {
return array();
}
$partnerId = $scope->getObject()->getPartnerId();
/* @var $scope kEventScope */
$metadataContentParameters = array();
foreach ($sweepFieldValues as $sweepFieldValue) {
//Obtain matches for the set structure {metadata:[profileSystemName][profileFieldSystemName]}
preg_match_all(self::METADATA_EMAIL_NOTIFICATION_REGEX, $sweepFieldValue, $matches);
foreach ($matches[0] as $match) {
$match = str_replace(array('{', '}'), array('', ''), $match);
list($metadata, $profileSystemName, $fieldSystemName, $format) = explode(':', $match, 4);
$profile = MetadataProfilePeer::retrieveBySystemName($profileSystemName, $partnerId);
if (!$profile) {
KalturaLog::info("Metadata profile with system name {$profileSystemName} not found for this partner. Token will be replaced with empty string.");
$metadataContentParameters[$match] = '';
continue;
}
$objectId = null;
$metadataObjectId = null;
//If the metadataProfileobjectType matches the one on the emailNotification, we can proceed
//If the objectType of the email template is 'asset' we can use the entryId
//If the objectType of the email template is a metadata object we can use its id
if (kMetadataManager::getObjectTypeName($profile->getObjectType()) == KalturaPluginManager::getObjectClass('EventNotificationEventObjectType', $objectType)) {
$objectId = $scope->getObject()->getId();
} elseif (kMetadataManager::getObjectTypeName($profile->getObjectType()) == 'entry' && $scope->getObject() instanceof asset) {
$objectId = $scope->getObject()->getEntryId();
} elseif ($scope->getObject() instanceof categoryEntry) {
$profileObject = kMetadataManager::getObjectTypeName($profile->getObjectType());
$getter = "get{$profileObject}Id";
KalturaLog::info("Using {$getter} in order to retrieve the metadata object ID");
$categoryEntry = $scope->getObject();
$objectId = $categoryEntry->{$getter}();
} elseif (KalturaPluginManager::getObjectClass('EventNotificationEventObjectType', $objectType) == MetadataPeer::OM_CLASS) {
$metadataObjectId = $scope->getObject()->getId();
}
if ($objectId) {
$result = MetadataPeer::retrieveByObject($profile->getId(), $profile->getObjectType(), $objectId);
} elseif ($metadataObjectId) {
$result = MetadataPeer::retrieveByPK($metadataObjectId);
} else {
//There is not enough specification regarding the required metadataObject, abort.
KalturaLog::info("The template does not contain an object Id for which custom metadata can be retrieved. Token will be replaced with empty string.");
$metadataContentParameters[$match] = '';
continue;
}
if (!$result) {
KalturaLog::info("Metadata object could not be retrieved. Token will be replaced with empty string.");
$metadataContentParameters[$match] = '';
continue;
}
$strvals = kMetadataManager::getMetadataValueForField($result, $fieldSystemName);
foreach ($strvals as &$strval) {
if ($format && is_numeric($strval)) {
$strval = date($format, $strval);
}
}
$metadataContentParameters[$match] = implode(',', $strvals);
}
}
return $metadataContentParameters;
}
示例15: getObject
public function getObject($objectType, array $properties, $add_underscore = true, $include_empty_fields = false)
{
if (isset($properties[self::EXTENSION_SUBFORM_NAME])) {
$properties = array_merge($properties[self::EXTENSION_SUBFORM_NAME], $properties);
}
$objectType = KalturaPluginManager::getObjectClass($objectType, $properties['type']);
$object = parent::getObject($objectType, $properties, $add_underscore, $include_empty_fields);
if ($object->fileHandlerType === Kaltura_Client_DropFolder_Enum_DropFolderFileHandlerType::CONTENT) {
$object->fileHandlerConfig = $this->getSubForm('contentHandlerConfig')->getObject('Kaltura_Client_DropFolder_Type_DropFolderContentFileHandlerConfig', $properties, $add_underscore, $include_empty_fields);
} else {
if ($object->fileHandlerType === Kaltura_Client_DropFolder_Enum_DropFolderFileHandlerType::XML) {
$object->fileHandlerConfig = new Kaltura_Client_DropFolderXmlBulkUpload_Type_DropFolderXmlBulkUploadFileHandlerConfig();
}
}
$extendTypeSubForm = $this->getSubForm(self::EXTENSION_SUBFORM_NAME);
if ($extendTypeSubForm) {
$object = $extendTypeSubForm->getObject($object, $objectType, $properties, $add_underscore, $include_empty_fields);
}
return $object;
}