本文整理匯總了PHP中kDataCenterMgr::getDCByObjectId方法的典型用法代碼示例。如果您正苦於以下問題:PHP kDataCenterMgr::getDCByObjectId方法的具體用法?PHP kDataCenterMgr::getDCByObjectId怎麽用?PHP kDataCenterMgr::getDCByObjectId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類kDataCenterMgr
的用法示例。
在下文中一共展示了kDataCenterMgr::getDCByObjectId方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: updateAction
/**
* Update media entry. Only the properties that were set will be updated.
*
* @action update
* @param string $entryId Media entry id to update
* @param KalturaMediaEntry $mediaEntry Media entry metadata to update
* @return KalturaMediaEntry The updated media entry
* @throws KalturaErrors::ENTRY_ID_NOT_FOUND
* @validateUser entry entryId edit
*/
function updateAction($entryId, KalturaMediaEntry $mediaEntry)
{
$dbEntry = entryPeer::retrieveByPK($entryId);
if (!$dbEntry) {
$dcIndex = kDataCenterMgr::getDCByObjectId($entryId, true);
if ($dcIndex != kDataCenterMgr::getCurrentDcId()) {
KalturaLog::debug("EntryID [{$entryId}] wasn't found on current DC. dumping the request to DC id [{$dcIndex}]");
kFileUtils::dumpApiRequest(kDataCenterMgr::getRemoteDcExternalUrlByDcId($dcIndex));
}
}
if (!$dbEntry || $dbEntry->getType() != KalturaEntryType::MEDIA_CLIP) {
throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $entryId);
}
$mediaEntry = $this->updateEntry($entryId, $mediaEntry, KalturaEntryType::MEDIA_CLIP);
return $mediaEntry;
}