本文整理匯總了PHP中entry::getReplacedEntryId方法的典型用法代碼示例。如果您正苦於以下問題:PHP entry::getReplacedEntryId方法的具體用法?PHP entry::getReplacedEntryId怎麽用?PHP entry::getReplacedEntryId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類entry
的用法示例。
在下文中一共展示了entry::getReplacedEntryId方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: handleEntryReplacement
/**
* @param entry $tempEntry
*/
public static function handleEntryReplacement(entry $tempEntry)
{
$entry = entryPeer::retrieveByPK($tempEntry->getReplacedEntryId());
if (!$entry) {
KalturaLog::err("Real entry id [" . $tempEntry->getReplacedEntryId() . "] not found");
myEntryUtils::deleteEntry($tempEntry, null, true);
return;
}
if ($tempEntry->getStatus() == entryStatus::ERROR_CONVERTING) {
$entry->setReplacementStatus(entryReplacementStatus::FAILED);
$entry->save();
// NOTE: KalturaEntryService::cancelReplace() must be used to reset this status and delete the temp entry
return;
}
switch ($entry->getReplacementStatus()) {
case entryReplacementStatus::APPROVED_BUT_NOT_READY:
KalturaLog::log("status changed to ready");
kEventsManager::raiseEventDeferred(new kObjectReadyForReplacmentEvent($tempEntry));
break;
case entryReplacementStatus::READY_BUT_NOT_APPROVED:
break;
case entryReplacementStatus::NOT_READY_AND_NOT_APPROVED:
$entry->setReplacementStatus(entryReplacementStatus::READY_BUT_NOT_APPROVED);
$entry->save();
break;
case entryReplacementStatus::FAILED:
// Do nothing. KalturaEntryService::cancelReplace() will be used to delete the entry.
break;
case entryReplacementStatus::NONE:
default:
KalturaLog::err("Real entry id [" . $tempEntry->getReplacedEntryId() . "] replacement canceled");
myEntryUtils::deleteEntry($tempEntry, null, true);
break;
}
}
示例2: onEntryReady
/**
* @param entry $entry
*/
public static function onEntryReady(entry $entry)
{
if (!ContentDistributionPlugin::isAllowedPartner($entry->getPartnerId())) {
return true;
}
//no temp entries should be handled
if ($entry->getDisplayInSearch() == mySearchUtils::DISPLAY_IN_SEARCH_SYSTEM && $entry->getReplacedEntryId()) {
return true;
}
$distributionProfiles = DistributionProfilePeer::retrieveByPartnerId($entry->getPartnerId());
foreach ($distributionProfiles as $distributionProfile) {
$entryDistribution = EntryDistributionPeer::retrieveByEntryAndProfileId($entry->getId(), $distributionProfile->getId());
if ($entryDistribution) {
KalturaLog::info("Found entry distribution object with id [" . $entryDistribution->getId() . "] for distrinution profle [" . $distributionProfile->getId() . "]");
self::onEntryDistributionUpdateRequired($entryDistribution);
continue;
}
if ($distributionProfile->getSubmitEnabled() == DistributionProfileActionStatus::AUTOMATIC) {
self::addEntryDistribution($entry, $distributionProfile, true);
}
}
return true;
}
示例3: handleEntryReplacement
/**
* @param entry $tempEntry
*/
public static function handleEntryReplacement(entry $tempEntry)
{
KalturaLog::debug("Handling temp entry id [" . $tempEntry->getId() . "] for real entry id [" . $tempEntry->getReplacedEntryId() . "]");
$entry = entryPeer::retrieveByPK($tempEntry->getReplacedEntryId());
if (!$entry) {
KalturaLog::err("Real entry id [" . $tempEntry->getReplacedEntryId() . "] not found");
myEntryUtils::deleteEntry($tempEntry, null, true);
return;
}
switch ($entry->getReplacementStatus()) {
case entryReplacementStatus::APPROVED_BUT_NOT_READY:
KalturaLog::debug("status changed to ready");
kEventsManager::raiseEventDeferred(new kObjectReadyForReplacmentEvent($tempEntry));
break;
case entryReplacementStatus::READY_BUT_NOT_APPROVED:
break;
case entryReplacementStatus::NOT_READY_AND_NOT_APPROVED:
$entry->setReplacementStatus(entryReplacementStatus::READY_BUT_NOT_APPROVED);
$entry->save();
break;
case entryReplacementStatus::NONE:
default:
KalturaLog::err("Real entry id [" . $tempEntry->getReplacedEntryId() . "] replacement canceled");
myEntryUtils::deleteEntry($tempEntry, null, true);
break;
}
}