/** * Update the content resource associated with the entry. * * @action updateContent * @param string $entryId Entry id to update * @param KalturaResource $resource Resource to be used to replace entry content * @param int $conversionProfileId The conversion profile id to be used on the entry * @return KalturaBaseEntry The updated entry * * @throws KalturaErrors::ENTRY_ID_NOT_FOUND * @validateUser entry entryId edit */ function updateContentAction($entryId, KalturaResource $resource, $conversionProfileId = null) { $dbEntry = entryPeer::retrieveByPK($entryId); if (!$dbEntry) { throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $entryId); } $baseEntry = new KalturaBaseEntry(); $baseEntry->fromObject($dbEntry); switch ($dbEntry->getType()) { case entryType::MEDIA_CLIP: $service = new MediaService(); $service->initService('media', 'media', $this->actionName); $service->replaceResource($resource, $dbEntry, $conversionProfileId); $baseEntry->fromObject($dbEntry); return $baseEntry; case entryType::MIX: case entryType::PLAYLIST: case entryType::DATA: case entryType::LIVE_STREAM: default: // TODO load from plugin manager other entry services such as document throw new KalturaAPIException(KalturaErrors::ENTRY_TYPE_NOT_SUPPORTED, $baseEntry->type); } return $baseEntry; }