本文整理汇总了PHP中myNotificationMgr::prepareNotificationData方法的典型用法代码示例。如果您正苦于以下问题:PHP myNotificationMgr::prepareNotificationData方法的具体用法?PHP myNotificationMgr::prepareNotificationData怎么用?PHP myNotificationMgr::prepareNotificationData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myNotificationMgr
的用法示例。
在下文中一共展示了myNotificationMgr::prepareNotificationData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getClientNotificationAction
/**
* Return the notifications for a specific entry id and type
*
* @action getClientNotification
* @param string $entryId
* @param KalturaNotificationType $type
* @return KalturaClientNotification
*/
function getClientNotificationAction($entryId, $type)
{
// in case of a multirequest, a mediaService.addFromUploadedFile may fail and therefore the resulting entry id will be empty
// in such a case return immidiately without looking for the notification
if ($entryId == '') {
throw new KalturaAPIException(KalturaErrors::NOTIFICATION_FOR_ENTRY_NOT_FOUND, $entryId);
}
$notifications = BatchJobPeer::retrieveByEntryIdAndType($entryId, BatchJobType::NOTIFICATION, $type);
// FIXME: throw error if not found
if (count($notifications) == 0) {
throw new KalturaAPIException(KalturaErrors::NOTIFICATION_FOR_ENTRY_NOT_FOUND, $entryId);
}
$notification = $notifications[0];
$partnerId = $this->getPartnerId();
$nofication_config_str = null;
list($nofity, $nofication_config_str) = myPartnerUtils::shouldNotify($partnerId);
if (!$nofity) {
return new KalturaClientNotification();
}
$nofication_config = myNotificationsConfig::getInstance($nofication_config_str);
$nofity_send_type = $nofication_config->shouldNotify($type);
if ($nofity_send_type != myNotificationMgr::NOTIFICATION_MGR_SEND_SYNCH && $nofity_send_type != myNotificationMgr::NOTIFICATION_MGR_SEND_BOTH) {
return new KalturaClientNotification();
}
$partner = PartnerPeer::retrieveByPK($partnerId);
list($url, $signatureKey) = myNotificationMgr::getPartnerNotificationInfo($partner);
list($params, $rawSignature) = myNotificationMgr::prepareNotificationData($url, $signatureKey, $notification, null);
$serializedParams = http_build_query($params, "", "&");
$result = new KalturaClientNotification();
$result->url = $url;
$result->data = $serializedParams;
return $result;
}
示例2: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
$prefix = null;
$notData = new kNotificationJobData();
$notData->setData('');
$notData->setType(kNotificationJobData::NOTIFICATION_TYPE_TEST);
$notData->setUserId($puser_id);
$job = new BatchJob();
$job->setId(kNotificationJobData::NOTIFICATION_TYPE_TEST + (int) time());
$job->setData($notData);
$job->setPartnerId($partner_id);
$partner = PartnerPeer::retrieveByPK($partner_id);
list($url, $signature_key) = myNotificationMgr::getPartnerNotificationInfo($partner);
list($params, $raw_siganture) = myNotificationMgr::prepareNotificationData($url, $signature_key, $job, $prefix);
$this->send($url, $params);
}