/** * @param int $partnerId * @param string $entryId * @param string $msg * @return flavorAsset */ public static function createOriginalFlavorAsset($partnerId, $entryId, &$msg = null) { $flavorAsset = flavorAssetPeer::retrieveOriginalByEntryId($entryId); if ($flavorAsset) { $flavorAsset->incrementVersion(); $flavorAsset->save(); return $flavorAsset; } $entry = entryPeer::retrieveByPK($entryId); if (!$entry) { KalturaLog::err("Entry [{$entryId}] not found"); return null; } // creates the flavor asset $flavorAsset = new flavorAsset(); $flavorAsset->setStatus(flavorAsset::FLAVOR_ASSET_STATUS_QUEUED); $flavorAsset->incrementVersion(); $flavorAsset->setIsOriginal(true); $flavorAsset->setPartnerId($partnerId); $flavorAsset->setEntryId($entryId); // // 2010-11-08 - Solved by Tan-Tan in DocumentCreatedHandler::objectAdded // // 2010-10-17 - Hotfix by Dor - source document asset with no conversion profile should be in status READY // if ($entry->getType() == entryType::DOCUMENT) // { // if (is_null($entry->conversionProfileId)) // { // $flavorAsset->setStatus(flavorAsset::FLAVOR_ASSET_STATUS_READY); // } // } // // ----- hotfix end $flavorAsset->save(); return $flavorAsset; }
/** * @param int $partnerId * @param string $entryId * @param string $msg * @return flavorAsset */ public static function createOriginalFlavorAsset($partnerId, $entryId, &$msg = null) { $flavorAsset = assetPeer::retrieveOriginalByEntryId($entryId); if ($flavorAsset) { // $flavorAsset->incrementVersion(); $flavorAsset->save(); return $flavorAsset; } $entry = entryPeer::retrieveByPK($entryId); if (!$entry) { KalturaLog::err("Entry [{$entryId}] not found"); return null; } // creates the flavor asset $flavorAsset = new flavorAsset(); $flavorAsset->setStatus(flavorAsset::FLAVOR_ASSET_STATUS_QUEUED); $flavorAsset->incrementVersion(); $flavorAsset->setIsOriginal(true); $flavorAsset->setPartnerId($partnerId); $flavorAsset->setEntryId($entryId); $flavorAsset->save(); return $flavorAsset; }