本文整理汇总了PHP中kEventsManager::raiseEventDeferred方法的典型用法代码示例。如果您正苦于以下问题:PHP kEventsManager::raiseEventDeferred方法的具体用法?PHP kEventsManager::raiseEventDeferred怎么用?PHP kEventsManager::raiseEventDeferred使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kEventsManager
的用法示例。
在下文中一共展示了kEventsManager::raiseEventDeferred方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexToSearchIndex
public function indexToSearchIndex()
{
kEventsManager::raiseEventDeferred(new kObjectReadyForIndexEvent($this));
}
示例2: updateAccessControl
public static function updateAccessControl($partnerId, $oldAccessControlId, $newAccessControlId)
{
$c = KalturaCriteria::create(entryPeer::OM_CLASS);
//trying to fetch more entries than the $entryCount limit
$c->setMaxRecords(self::ENTRIES_PER_ACCESS_CONTROL_UPDATE_LIMIT + 1);
$c->add(entryPeer::ACCESS_CONTROL_ID, $oldAccessControlId);
$partner = PartnerPeer::retrieveByPK($partnerId);
$partnerEntitlement = $partner->getDefaultEntitlementEnforcement();
kEntitlementUtils::initEntitlementEnforcement($partnerId, false);
$entries = self::doSelect($c);
$entryCount = count($entries);
if ($entryCount == 0) {
return;
}
if ($entryCount > self::ENTRIES_PER_ACCESS_CONTROL_UPDATE_LIMIT) {
throw new kCoreException("exceeded max entries per access control update limit", kCoreException::EXCEEDED_MAX_ENTRIES_PER_ACCESS_CONTROL_UPDATE_LIMIT);
}
$entryIds = array();
foreach ($entries as $entry) {
$entryIds[] = $entry->getId();
}
$selectCriteria = new Criteria();
$selectCriteria->add(entryPeer::PARTNER_ID, $partnerId);
$selectCriteria->add(entryPeer::ID, $entryIds, Criteria::IN);
$updateValues = new Criteria();
$updateValues->add(entryPeer::ACCESS_CONTROL_ID, $newAccessControlId);
$con = Propel::getConnection(self::DATABASE_NAME);
BasePeer::doUpdate($selectCriteria, $updateValues, $con);
foreach ($entries as $entry) {
kEventsManager::raiseEventDeferred(new kObjectReadyForIndexEvent($entry));
}
if ($partnerEntitlement) {
kEntitlementUtils::initEntitlementEnforcement($partnerId, true);
}
}
示例3: objectAdded
public function objectAdded(BaseObject $object, BatchJob $raisedJob = null)
{
KalturaLog::debug("Raising deferred event for object of type: " . get_class($object));
kEventsManager::raiseEventDeferred(new kObjectReadyForIndexEvent($object));
return true;
}
示例4: 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;
}
}
示例5: indexToSearchIndex
/**
* Index the object in the search engine
*/
public function indexToSearchIndex()
{
if ($this->getObjectType() == MetadataObjectType::DYNAMIC_OBJECT) {
kEventsManager::raiseEventDeferred(new kObjectReadyForIndexEvent($this));
}
}
示例6: 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;
}
}