本文整理汇总了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;
}
}