<commit_before><?php

/**
 * Subclass for representing a row from the 'flavor_asset' table.
 *
 * 
 *
 * @package Core
 * @subpackage model
 */ 
class asset extends Baseasset implements ISyncableFile
{
	const FLAVOR_ASSET_STATUS_ERROR = -1;
	const FLAVOR_ASSET_STATUS_QUEUED = 0;
	const FLAVOR_ASSET_STATUS_CONVERTING = 1;
	const FLAVOR_ASSET_STATUS_READY = 2;
	const FLAVOR_ASSET_STATUS_DELETED = 3;
	const FLAVOR_ASSET_STATUS_NOT_APPLICABLE = 4;
	const FLAVOR_ASSET_STATUS_TEMP = 5; // used during conversion and should be deleted
	
	const FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET = 1;
	const FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_CONVERT_LOG = 2;
	
	public function copyToEntry($entryId = null, $partnerId = null)
	{
		$newFlavorAsset = $this->copy();
		
		if($partnerId)
			$newFlavorAsset->setPartnerId($partnerId);
		if($entryId)
			$newFlavorAsset->setEntryId($entryId);
		$newFlavorAsset->save();
		
		$flavorParamsOutput = flavorParamsOutputPeer::retrieveByFlavorAssetId($this->getId());
		if($flavorParamsOutput)
		{
			$newFlavorParamsOutput = $flavorParamsOutput->copy();
			$newFlavorParamsOutput->setPartnerId($newFlavorAsset->getPartnerId());
			$newFlavorParamsOutput->setEntryId($newFlavorAsset->getEntryId());
			$newFlavorParamsOutput->setFlavorAssetId($newFlavorAsset->getId());
			$newFlavorParamsOutput->save();
		}
		
		$mediaInfo = mediaInfoPeer::retrieveByFlavorAssetId($this->getId());<commit_msg>Support WAIT_FOR_CONVERT asset status<commit_after><?php

/**
 * Subclass for representing a row from the 'flavor_asset' table.
 *
 * 
 *
 * @package Core
 * @subpackage model
 */ 
class asset extends Baseasset implements ISyncableFile
{
	const FLAVOR_ASSET_STATUS_ERROR = -1;
	const FLAVOR_ASSET_STATUS_QUEUED = 0;
	const FLAVOR_ASSET_STATUS_CONVERTING = 1;
	const FLAVOR_ASSET_STATUS_READY = 2;
	const FLAVOR_ASSET_STATUS_DELETED = 3;
	const FLAVOR_ASSET_STATUS_NOT_APPLICABLE = 4;
	const FLAVOR_ASSET_STATUS_TEMP = 5; // used during conversion and should be deleted
	const FLAVOR_ASSET_STATUS_WAIT_FOR_CONVERT = 6; // can't convert since the source is not ready yet, will be converted when the source is ready
	
	const FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET = 1;
	const FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_CONVERT_LOG = 2;
	
	public function copyToEntry($entryId = null, $partnerId = null)
	{
		$newFlavorAsset = $this->copy();
		
		if($partnerId)
			$newFlavorAsset->setPartnerId($partnerId);
		if($entryId)
			$newFlavorAsset->setEntryId($entryId);
		$newFlavorAsset->save();
		
		$flavorParamsOutput = flavorParamsOutputPeer::retrieveByFlavorAssetId($this->getId());
		if($flavorParamsOutput)
		{
			$newFlavorParamsOutput = $flavorParamsOutput->copy();
			$newFlavorParamsOutput->setPartnerId($newFlavorAsset->getPartnerId());
			$newFlavorParamsOutput->setEntryId($newFlavorAsset->getEntryId());
			$newFlavorParamsOutput->setFlavorAssetId($newFlavorAsset->getId());
			$newFlavorParamsOutput->save();
		}
		
		$mediaInfo = mediaInfoPeer::retrieveByFlavorAssetId($this->getId());
{'fraction_non_alphanumeric': 0.10947930574098798, 'fraction_numerical': 0.006341789052069426, 'mean_word_length': 6.051764705882353, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5597381', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1069, 'n_words': 178}