本文整理汇总了PHP中myNotificationMgr::createNotification方法的典型用法代码示例。如果您正苦于以下问题:PHP myNotificationMgr::createNotification方法的具体用法?PHP myNotificationMgr::createNotification怎么用?PHP myNotificationMgr::createNotification使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myNotificationMgr
的用法示例。
在下文中一共展示了myNotificationMgr::createNotification方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
if (!$puser_kuser) {
$this->addError(APIErrors::INVALID_USER_ID, $puser_id);
return;
}
$time_offset = $this->getPM("time_offset");
$entry_ids = $this->getPM("entry_ids");
$detailed = $this->getP("detailed", false);
$separator = $this->getP("separator", ",");
$id_arr = explode($separator, $entry_ids);
$limit = 50;
$id_arr = array_splice($id_arr, 0, $limit);
$entries = entryPeer::retrieveByPKs($id_arr);
$updated_entries = array();
if (!$entries) {
$this->addError(APIErrors::INVALID_ENTRY_IDS, $entry_ids);
} else {
foreach ($entries as $entry) {
if (!myEntryUtils::createThumbnailFromEntry($entry, $entry, $time_offset)) {
$this->addError(APIErrors::INVALID_ENTRY_TYPE, "ENTRY_TYPE_MEDIACLIP [" . $entry->getId() . "]");
continue;
}
$updated_entries[] = $entry;
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_UPDATE_THUMBNAIL, $entry);
$wrapper = objectWrapperBase::getWrapperClass($entry, objectWrapperBase::DETAIL_LEVEL_DETAILED);
$wrapper->removeFromCache("entry", $entry->getId());
}
}
$this->addMsg("entries", objectWrapperBase::getWrapperClass($updated_entries, objectWrapperBase::DETAIL_LEVEL_REGULAR));
}
示例2: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
$kshow_id_to_delete = $this->getPM("kshow_id");
$kshow_to_delete = kshowPeer::retrieveByPK($kshow_id_to_delete);
if (!$kshow_to_delete) {
$this->addError(APIErrors::INVALID_KSHOW_ID, $kshow_id_to_delete);
return;
}
$kshow_to_delete->delete();
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_KSHOW_DELETE, $kshow_to_delete);
$this->addMsg("deleted_kshow", objectWrapperBase::getWrapperClass($kshow_to_delete, objectWrapperBase::DETAIL_LEVEL_REGULAR));
}
示例3: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
$prefix = $this->getObjectPrefix();
if (!$puser_kuser) {
$this->addError(APIErrors::INVALID_USER_ID, $puser_id);
return;
}
$allow_empty = $this->getP("allow_empty_field", false);
if ($allow_empty == "false" || $allow_empty === 0) {
$allow_empty = false;
}
$entry_id = $this->getPM("{$prefix}_id");
$entry = entryPeer::retrieveByPK($entry_id);
if (!$entry) {
$this->addError(APIErrors::INVALID_ENTRY_ID, $prefix, $entry_id);
return;
}
$this->validateInputEntry($entry);
// TODO - verify the user is allowed to modify the entry
if (!$this->isOwnedBy($entry, $puser_kuser->getKuserId())) {
$this->verifyEntryPrivileges($entry);
// user was granted explicit permissions when initiatd the ks
}
// get the new properties for the kuser from the request
$entry_update_data = new entry();
// assume the type and media_type of the entry from the DB are the same as those of the one from the user - if not -they will be overriden
$entry_update_data->setType($entry->getType());
$entry_update_data->setMediaType($entry->getMediaType());
$entry_update_data->setId($entry->getId());
$entry_update_data->setPartnerId($entry->getPartnerId());
$entry_update_data->setData($entry->getData(), true);
$obj_wrapper = objectWrapperBase::getWrapperClass($entry_update_data, 0);
$field_level = $this->isAdmin() ? 2 : 1;
$updateable_fields = $obj_wrapper->getUpdateableFields($field_level);
$fields_modified = baseObjectUtils::fillObjectFromMap($this->getInputParams(), $entry_update_data, "{$prefix}_", $updateable_fields, BasePeer::TYPE_PHPNAME, $allow_empty);
if (count($fields_modified) > 0) {
if ($entry_update_data) {
// allow admins to set admin more fields
baseObjectUtils::fillObjectFromObject($updateable_fields, $entry_update_data, $entry, baseObjectUtils::CLONE_POLICY_PREFER_NEW, null, BasePeer::TYPE_PHPNAME, $allow_empty);
}
$this->validateEntry($entry);
// TODO - chack to see that the permissions changed, not just any attributes
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_UPDATE_PERMISSIONS, $entry);
$entry->save();
}
$wrapper = objectWrapperBase::getWrapperClass($entry, objectWrapperBase::DETAIL_LEVEL_DETAILED);
$wrapper->removeFromCache("entry", $entry->getId());
$this->addMsg("{$prefix}", $wrapper);
$this->addDebug("modified_fields", $fields_modified);
}
示例4: addFromUploadedFileAction
/**
* Add new document entry after the specific document file was uploaded and the upload token id exists
*
* @action addFromUploadedFile
* @param KalturaDocumentEntry $documentEntry Document entry metadata
* @param string $uploadTokenId Upload token id
* @return KalturaDocumentEntry The new document entry
*
* @throws KalturaErrors::PROPERTY_VALIDATION_MIN_LENGTH
* @throws KalturaErrors::PROPERTY_VALIDATION_CANNOT_BE_NULL
* @throws KalturaErrors::UPLOADED_FILE_NOT_FOUND_BY_TOKEN
*/
function addFromUploadedFileAction(KalturaDocumentEntry $documentEntry, $uploadTokenId)
{
try {
// check that the uploaded file exists
$entryFullPath = kUploadTokenMgr::getFullPathByUploadTokenId($uploadTokenId);
} catch (kCoreException $ex) {
if ($ex->getCode() == kUploadTokenException::UPLOAD_TOKEN_INVALID_STATUS) {
}
throw new KalturaAPIException(KalturaErrors::UPLOAD_TOKEN_INVALID_STATUS_FOR_ADD_ENTRY);
throw $ex;
}
if (!file_exists($entryFullPath)) {
$remoteDCHost = kUploadTokenMgr::getRemoteHostForUploadToken($uploadTokenId, kDataCenterMgr::getCurrentDcId());
if ($remoteDCHost) {
kFile::dumpApiRequest($remoteDCHost);
} else {
throw new KalturaAPIException(KalturaErrors::UPLOADED_FILE_NOT_FOUND_BY_TOKEN);
}
}
$dbEntry = $this->prepareEntryForInsert($documentEntry);
$dbEntry->setSource(KalturaSourceType::FILE);
$dbEntry->setSourceLink("file:{$entryFullPath}");
$dbEntry->save();
$te = new TrackEntry();
$te->setEntryId($dbEntry->getId());
$te->setTrackEventTypeId(TrackEntry::TRACK_ENTRY_EVENT_TYPE_ADD_ENTRY);
$te->setDescription(__METHOD__ . ":" . __LINE__ . "::ENTRY_MEDIA_SOURCE_FILE");
TrackEntry::addTrackEntry($te);
$msg = null;
$flavorAsset = kFlowHelper::createOriginalFlavorAsset($this->getPartnerId(), $dbEntry->getId(), $msg);
if (!$flavorAsset) {
KalturaLog::err("Flavor asset not created for entry [" . $dbEntry->getId() . "] reason [{$msg}]");
$dbEntry->setStatus(entryStatus::ERROR_CONVERTING);
$dbEntry->save();
} else {
$ext = pathinfo($entryFullPath, PATHINFO_EXTENSION);
KalturaLog::info("Uploaded file extension: {$ext}");
$flavorAsset->setFileExt($ext);
$flavorAsset->save();
$syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
kFileSyncUtils::moveFromFile($entryFullPath, $syncKey);
kEventsManager::raiseEvent(new kObjectAddedEvent($flavorAsset));
}
kUploadTokenMgr::closeUploadTokenById($uploadTokenId);
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_ADD, $dbEntry);
$documentEntry->fromObject($dbEntry);
return $documentEntry;
}
示例5: addAction
/**
* Adds a new data entry
*
* @action add
* @param KalturaDataEntry $dataEntry Data entry
* @return KalturaDataEntry The new data entry
*/
function addAction(KalturaDataEntry $dataEntry)
{
$dbEntry = $dataEntry->toObject(new entry());
$this->checkAndSetValidUser($dataEntry, $dbEntry);
$this->checkAdminOnlyInsertProperties($dataEntry);
$this->validateAccessControlId($dataEntry);
$this->validateEntryScheduleDates($dataEntry);
$dbEntry->setPartnerId($this->getPartnerId());
$dbEntry->setSubpId($this->getPartnerId() * 100);
$dbEntry->setStatus(KalturaEntryStatus::READY);
$dbEntry->setMediaType(entry::ENTRY_MEDIA_TYPE_AUTOMATIC);
$dbEntry->save();
$dataEntry->fromObject($dbEntry);
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_ADD, $dbEntry);
return $dataEntry;
}
示例6: addNotification
public function addNotification($notification_type, $object_data, $partner_id = null, $puser_id = null)
{
$index = 1 + count($this->m_not_list);
$prefix = "not{$index}_";
@(list($temp_not_id, $temp_not, $temp_url, $temp_params, $temp_serialized_params) = myNotificationMgr::createNotification($notification_type, $object_data, $partner_id, $puser_id, $prefix));
@(list($not_id, $not, $url, $params, $serialized_params) = array($temp_not_id, $temp_not, $temp_url, $temp_params, $temp_serialized_params));
$this->m_not_list[] = $not;
$this->m_not_id_list[] = $not_id;
if ($this->m_url != null && $this->m_url != $url) {
// ERROR !
}
$this->m_url = $url;
// assume all URLs are the same
array_merge($this->m_params, $params);
// accumulate the params
$this->m_serialized_params = $serialized_params;
}
示例7: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
if (!$puser_kuser) {
$this->addError(APIErrors::INVALID_USER_ID, $puser_id);
return;
}
$entry_id = $this->getPM("entry_id");
$entry = entryPeer::retrieveByPK($entry_id);
// TODO - verify the user is allowed to modify the entry
$source_entry_id = $this->getP("source_entry_id");
if ($source_entry_id) {
$source_entry = entryPeer::retrieveByPK($source_entry_id);
if (!$source_entry) {
return;
}
} else {
$source_entry = $entry;
}
$time_offset = $this->getP("time_offset", -1);
if (!myEntryUtils::createThumbnailFromEntry($entry, $source_entry, $time_offset)) {
$this->addError(APIErrors::INVALID_ENTRY_TYPE, "ENTRY_TYPE_MEDIACLIP");
return;
}
if ($entry->getType() == entryType::MIX) {
/*
$roughcutPath = myContentStorage::getFSContentRootPath() . $entry->getDataPath(); // replaced__getDataPath
$xml_doc = new DOMDocument();
$xml_doc->load( $roughcutPath );
if (myMetadataUtils::updateThumbUrl($xml_doc, $entry->getThumbnailUrl()))
$xml_doc->save($roughcutPath);
*/
$sync_key = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA);
$xml_doc = new DOMDocument();
$xml_doc->loadXML(kFileSyncUtils::file_get_contents($sync_key));
if (myMetadataUtils::updateThumbUrl($xml_doc, $entry->getThumbnailUrl())) {
$entry->setMetadata(null, $xml_doc->saveXML(), true, null, null);
//$entry->getVersion() );
}
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_UPDATE_THUMBNAIL, $entry);
}
$wrapper = objectWrapperBase::getWrapperClass($entry, objectWrapperBase::DETAIL_LEVEL_DETAILED);
$wrapper->removeFromCache("entry", $entry->getId());
$this->addMsg("entry", $wrapper);
}
示例8: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
$kshow_id = $this->getPM("kshow_id");
$rank = $this->getPM("rank");
$kshow = kshowPeer::retrieveByPK($kshow_id);
if (!$kshow) {
$this->addError(APIErrors::INVALID_KSHOW_ID, $kshow_id);
return;
}
if ($rank > entry::MAX_NORMALIZED_RANK || $rank < 0 || !is_numeric($rank)) {
$this->addError(APIErrors::INVALID_RANK, $rank);
return;
}
$kuser_id = $puser_kuser->getKuserId();
$entry_id = $kshow->getShowEntryId();
$partner = PartnerPeer::retrieveByPK($partner_id);
if (!$partner->getAllowAnonymousRanking()) {
// prevent duplicate votes
$c = new Criteria();
$c->add(kvotePeer::KUSER_ID, $kuser_id);
$c->add(kvotePeer::ENTRY_ID, $entry_id);
$c->add(kvotePeer::KSHOW_ID, $kshow_id);
$kvote = kvotePeer::doSelectOne($c);
if ($kvote != NULL) {
$this->addError(APIErrors::USER_ALREADY_RANKED_KSHOW, $puser_id, $kshow_id);
return;
}
}
$kvote = new kvote();
$kvote->setKshowId($kshow_id);
$kvote->setEntryId($entry_id);
$kvote->setKuserId($kuser_id);
$kvote->setRank($rank);
$kvote->save();
$statistics_results = $kvote->getStatisticsResults();
$updated_kshow = @$statistics_results["kshow"];
if ($updated_kshow) {
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_KSHOW_RANK, $updated_kshow);
$data = array("kshow_id" => $kshow_id, "uid" => $puser_id, "rank" => $updated_kshow->getRank(), "votes" => $updated_kshow->getVotes());
//$this->addMsg ( "kshow" , objectWrapperBase::getWrapperClass( $updated_kshow , objectWrapperBase::DETAIL_LEVEL_DETAILED) );
$this->addMsg("rank", $data);
}
}
示例9: addAction
/**
* Adds new live stream entry.
* The entry will be queued for provision.
*
* @action add
* @param KalturaLiveStreamAdminEntry $liveStreamEntry Live stream entry metadata
* @param KalturaSourceType $sourceType Live stream source type
* @return KalturaLiveStreamAdminEntry The new live stream entry
*
* @throws KalturaErrors::PROPERTY_VALIDATION_CANNOT_BE_NULL
*/
function addAction(KalturaLiveStreamAdminEntry $liveStreamEntry, $sourceType = null)
{
//TODO: allow sourceType that belongs to LIVE entries only - same for mediaType
if ($sourceType) {
$liveStreamEntry->sourceType = $sourceType;
} else {
// default sourceType is AKAMAI_LIVE
$liveStreamEntry->sourceType = kPluginableEnumsManager::coreToApi('EntrySourceType', $this->getPartner()->getDefaultLiveStreamEntrySourceType());
}
// if the given password is empty, generate a random 8-character string as the new password
if ($liveStreamEntry->streamPassword == null || strlen(trim($liveStreamEntry->streamPassword)) <= 0) {
$tempPassword = sha1(md5(uniqid(rand(), true)));
$liveStreamEntry->streamPassword = substr($tempPassword, rand(0, strlen($tempPassword) - 8), 8);
}
// if no bitrate given, add default
if (is_null($liveStreamEntry->bitrates) || !$liveStreamEntry->bitrates->count) {
$liveStreamBitrate = new KalturaLiveStreamBitrate();
$liveStreamBitrate->bitrate = self::DEFAULT_BITRATE;
$liveStreamBitrate->width = self::DEFAULT_WIDTH;
$liveStreamBitrate->height = self::DEFAULT_HEIGHT;
$liveStreamEntry->bitrates = new KalturaLiveStreamBitrateArray();
$liveStreamEntry->bitrates[] = $liveStreamBitrate;
} else {
$bitrates = new KalturaLiveStreamBitrateArray();
foreach ($liveStreamEntry->bitrates as $bitrate) {
if (is_null($bitrate->bitrate)) {
$bitrate->bitrate = self::DEFAULT_BITRATE;
}
if (is_null($bitrate->width)) {
$bitrate->bitrate = self::DEFAULT_WIDTH;
}
if (is_null($bitrate->height)) {
$bitrate->bitrate = self::DEFAULT_HEIGHT;
}
$bitrates[] = $bitrate;
}
$liveStreamEntry->bitrates = $bitrates;
}
$dbEntry = $this->insertLiveStreamEntry($liveStreamEntry);
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_ADD, $dbEntry, $this->getPartnerId(), null, null, null, $dbEntry->getId());
$liveStreamEntry->fromObject($dbEntry);
return $liveStreamEntry;
}
示例10: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
if (!$puser_kuser) {
$this->addError(APIErrors::INVALID_USER_ID, $puser_id);
return;
}
$entry_id = $this->getPM("entry_id");
$entry = entryPeer::retrieveByPK($entry_id);
// TODO - verify the user is allowed to modify the entry
if ($entry->getKshowId() === kshow::SANDBOX_ID) {
$this->addError(APIErrors::SANDBOX_ALERT);
return;
}
$entry->setThumbnail(".jpg");
$entry->setCreateThumb(false);
$entry->save();
if (isset($HTTP_RAW_POST_DATA)) {
$thumb_data = $HTTP_RAW_POST_DATA;
} else {
$thumb_data = file_get_contents("php://input");
}
$thumb_data_size = strlen($thumb_data);
$fileSyncKey = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_THUMB);
$fileSync = FileSync::createForFileSyncKey($fileSyncKey);
kFileSyncUtils::file_put_contents($fileSyncKey, $thumb_data);
// update the metadata in case of a roughcut
if ($entry->getType() == entryType::MIX) {
$sync_key = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA);
$xml_doc = new DOMDocument();
$xml_doc->loadXML(kFileSyncUtils::file_get_contents($sync_key));
if (myMetadataUtils::updateThumbUrl($xml_doc, $entry->getThumbnailUrl())) {
$entry->setMetadata(null, $xml_doc->saveXML(), true, null, null);
//$entry->getVersion() );
}
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_UPDATE_THUMBNAIL, $entry);
}
$this->res = $entry->getBigThumbnailUrl();
$wrapper = objectWrapperBase::getWrapperClass($entry, objectWrapperBase::DETAIL_LEVEL_REGULAR);
$wrapper->removeFromCache("entry", $entry->getId());
$this->addMsg("entry", $wrapper);
}
示例11: addAction
/**
* Adds a new data entry
*
* @action add
* @param KalturaDataEntry $dataEntry Data entry
* @return KalturaDataEntry The new data entry
*/
function addAction(KalturaDataEntry $dataEntry)
{
$dbEntry = $dataEntry->toObject(new entry());
$this->checkAndSetValidUserInsert($dataEntry, $dbEntry);
$this->checkAdminOnlyInsertProperties($dataEntry);
$this->validateAccessControlId($dataEntry);
$this->validateEntryScheduleDates($dataEntry, $dbEntry);
$dbEntry->setPartnerId($this->getPartnerId());
$dbEntry->setSubpId($this->getPartnerId() * 100);
$dbEntry->setStatus(KalturaEntryStatus::READY);
$dbEntry->setMediaType(entry::ENTRY_MEDIA_TYPE_AUTOMATIC);
$dbEntry->save();
$trackEntry = new TrackEntry();
$trackEntry->setEntryId($dbEntry->getId());
$trackEntry->setTrackEventTypeId(TrackEntry::TRACK_ENTRY_EVENT_TYPE_ADD_ENTRY);
$trackEntry->setDescription(__METHOD__ . ":" . __LINE__ . "::ENTRY_DATA");
TrackEntry::addTrackEntry($trackEntry);
$dataEntry->fromObject($dbEntry);
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_ADD, $dbEntry);
return $dataEntry;
}
示例12: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
$entry_id = $this->getPM("entry_id");
$moderation_status = $this->getPM("moderation_status");
entryPeer::allowDeletedInCriteriaFilter();
$entry = entryPeer::retrieveByPK($entry_id);
if ($entry) {
// when setting the moderation status- propagate to all related moderation objects
$entry->moderate($moderation_status, true);
$entry->setModerationCount(0);
// set the number of unhandled flags to 0
$entry->save();
// for no wodn't add an extra notification - one is sent from within the entry->moderate()
// TODO - where is the best place to notify ??
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_UPDATE, $entry, null, null, null, null, $entry_id);
}
entryPeer::blockDeletedInCriteriaFilter();
$wrapper = objectWrapperBase::getWrapperClass($entry, objectWrapperBase::DETAIL_LEVEL_DETAILED);
if ($entry) {
$wrapper->removeFromCache("entry", $entry->getId());
}
$this->addMsg("entry", $wrapper);
}
示例13: addAction
/**
* Adds new live stream entry.
* The entry will be queued for provision.
*
* @action add
* @param KalturaLiveStreamEntry $liveStreamEntry Live stream entry metadata
* @param KalturaSourceType $sourceType Live stream source type
* @return KalturaLiveStreamEntry The new live stream entry
*
* @throws KalturaErrors::PROPERTY_VALIDATION_CANNOT_BE_NULL
*/
function addAction(KalturaLiveStreamEntry $liveStreamEntry, $sourceType = null)
{
if ($sourceType) {
$liveStreamEntry->sourceType = $sourceType;
} elseif (is_null($liveStreamEntry->sourceType)) {
// default sourceType is AKAMAI_LIVE
$liveStreamEntry->sourceType = kPluginableEnumsManager::coreToApi('EntrySourceType', $this->getPartner()->getDefaultLiveStreamEntrySourceType());
}
$dbEntry = $this->prepareEntryForInsert($liveStreamEntry);
$dbEntry->save();
$te = new TrackEntry();
$te->setEntryId($dbEntry->getId());
$te->setTrackEventTypeId(TrackEntry::TRACK_ENTRY_EVENT_TYPE_ADD_ENTRY);
$te->setDescription(__METHOD__ . ":" . __LINE__ . "::" . $dbEntry->getSource());
TrackEntry::addTrackEntry($te);
//If a jobData can be created for entry sourceType, add provision job. Otherwise, just save the entry.
$jobData = kProvisionJobData::getInstance($dbEntry->getSource());
if ($jobData) {
/* @var $data kProvisionJobData */
$jobData->populateFromPartner($dbEntry->getPartner());
$jobData->populateFromEntry($dbEntry);
kJobsManager::addProvisionProvideJob(null, $dbEntry, $jobData);
} else {
$dbEntry->setStatus(entryStatus::READY);
$dbEntry->save();
$liveAssets = assetPeer::retrieveByEntryId($dbEntry->getId(), array(assetType::LIVE));
foreach ($liveAssets as $liveAsset) {
/* @var $liveAsset liveAsset */
$liveAsset->setStatus(asset::ASSET_STATUS_READY);
$liveAsset->save();
}
}
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_ADD, $dbEntry, $this->getPartnerId(), null, null, null, $dbEntry->getId());
$liveStreamEntry->fromObject($dbEntry, $this->getResponseProfile());
return $liveStreamEntry;
}
示例14: approveEntry
protected function approveEntry($entryId, $entryType = null)
{
$dbEntry = entryPeer::retrieveByPK($entryId);
if (!$dbEntry || $entryType !== null && $dbEntry->getType() != $entryType) {
throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $entryId);
}
$dbEntry->setModerationStatus(KalturaEntryModerationStatus::APPROVED);
$dbEntry->setModerationCount(0);
$updateOccurred = $dbEntry->save();
if ($updateOccurred) {
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_UPDATE, $dbEntry, null, null, null, null, $dbEntry->getId());
}
// myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_BLOCK , $dbEntry->getId());
moderationFlagPeer::markAsModeratedByEntryId($this->getPartnerId(), $dbEntry->getId());
}
示例15: handleBulkDownloadPending
public static function handleBulkDownloadPending(BatchJob $dbBatchJob, kBulkDownloadJobData $data, BatchJob $twinJob = null)
{
$entryIds = explode(',', $data->getEntryIds());
$flavorParamsId = $data->getFlavorParamsId();
$jobIsFinished = true;
foreach ($entryIds as $entryId) {
$entry = entryPeer::retrieveByPK($entryId);
if (is_null($entry)) {
KalturaLog::err("Entry id [{$entryId}] not found.");
} else {
if ($entry->hasDownloadAsset($flavorParamsId)) {
// why we don't send the notification in case of image is ready?
$flavorAsset = flavorAssetPeer::retrieveByEntryIdAndFlavorParams($entryId, $flavorParamsId);
if ($flavorAsset && $flavorAsset->getStatus() == flavorAsset::FLAVOR_ASSET_STATUS_READY) {
$syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
$downloadUrl = $flavorAsset->getDownloadUrl();
$localPath = kFileSyncUtils::getLocalFilePathForKey($syncKey);
$downloadUrl = $flavorAsset->getDownloadUrl();
$notificationData = array("puserId" => $entry->getPuserId(), "entryId" => $entry->getId(), "entryIntId" => $entry->getIntId(), "entryVersion" => $entry->getVersion(), "fileFormat" => $flavorAsset->getFileExt(), "archivedFile" => $localPath, "downoladPath" => $localPath, "conversionQuality" => $entry->getConversionQuality(), "downloadUrl" => $downloadUrl);
$extraData = array("data" => json_encode($notificationData), "partner_id" => $entry->getPartnerId(), "puser_id" => $entry->getPuserId(), "entry_id" => $entry->getId(), "entry_int_id" => $entry->getIntId(), "entry_version" => $entry->getVersion(), "file_format" => $flavorAsset->getFileExt(), "archived_file" => $localPath, "downolad_path" => $localPath, "target" => $localPath, "conversion_quality" => $entry->getConversionQuality(), "download_url" => $downloadUrl, "status" => $entry->getStatus(), "abort" => $dbBatchJob->getAbort(), "progress" => $dbBatchJob->getProgress(), "message" => $dbBatchJob->getMessage(), "description" => $dbBatchJob->getDescription(), "updates_count" => $dbBatchJob->getUpdatesCount(), "job_type" => BatchJobType::DOWNLOAD, "status" => BatchJob::BATCHJOB_STATUS_FINISHED, "progress" => 100, "debug" => __LINE__);
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_BATCH_JOB_SUCCEEDED, $dbBatchJob, $dbBatchJob->getPartnerId(), null, null, $extraData, $entryId);
}
} else {
$jobIsFinished = false;
$entry->createDownloadAsset($dbBatchJob, $flavorParamsId, $data->getPuserId());
}
}
}
if ($jobIsFinished) {
// mark the job as finished
$dbBatchJob = kJobsManager::updateBatchJob($dbBatchJob, BatchJob::BATCHJOB_STATUS_FINISHED);
} else {
// mark the job as almost done
$dbBatchJob = kJobsManager::updateBatchJob($dbBatchJob, BatchJob::BATCHJOB_STATUS_ALMOST_DONE);
}
return $dbBatchJob;
}