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