示例#1
0
 /**
  * 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;
 }