コード例 #1
0
ファイル: kFlowHelper.php プロジェクト: richhl/kalturaCE
 /**
  * @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;
 }
コード例 #2
0
 /**
  * @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;
 }
コード例 #3
0
ファイル: kBatchManager.php プロジェクト: richhl/kalturaCE
 /**
  * batch createFlavorAsset orgenize a convert job data 
  * 
  * @param flavorParamsOutputWrap $flavor
  * @param int $partnerId
  * @param int $entryId
  * @param string $description
  * @return flavorAsset
  */
 public static function createErrorFlavorAsset(flavorParamsOutputWrap $flavor, $partnerId, $entryId, $description)
 {
     $flavorAsset = flavorAssetPeer::retrieveByEntryIdAndFlavorParams($entryId, $flavor->getFlavorParamsId());
     if ($flavorAsset) {
         $description = $flavorAsset->getDescription() . "\n" . $description;
         $flavorAsset->setDescription($description);
         $flavorAsset->incrementVersion();
     } else {
         // creates the flavor asset
         $flavorAsset = new flavorAsset();
         $flavorAsset->setPartnerId($partnerId);
         $flavorAsset->setEntryId($entryId);
         $flavorAsset->setDescription($description);
     }
     $flavorAsset->setTags($flavor->getTags());
     $flavorAsset->setStatus(flavorAsset::FLAVOR_ASSET_STATUS_ERROR);
     $flavorAsset->setFlavorParamsId($flavor->getFlavorParamsId());
     $flavorAsset->setFileExt($flavor->getFileExt());
     $flavorAsset->save();
     // save flavor params
     $flavor->setPartnerId($partnerId);
     $flavor->setEntryId($entryId);
     $flavor->setFlavorAssetId($flavorAsset->getId());
     $flavor->setFlavorAssetVersion($flavorAsset->getVersion());
     $flavor->save();
     return $flavorAsset;
 }