public static function shalowClone(kshow $source_kshow, $new_prodcuer_id) { $target_kshow = $source_kshow->copy(); $target_kshow->setProducerId($new_prodcuer_id); $target_kshow->save(); self::resetKshowStats($target_kshow, true); if (!$source_kshow->getEpisodeId()) { $target_kshow->setEpisodeId($source_kshow->getId()); } //$target_kshow->setHasRoughcut($source_kshow->getHasRoughcut()); $target_show_entry = $target_kshow->createEntry(entry::ENTRY_MEDIA_TYPE_SHOW, $new_prodcuer_id); $content = myContentStorage::getFSContentRootPath(); $source_thumbnail_path = $source_kshow->getThumbnailPath(); $target_kshow->setThumbnail(null); $target_kshow->setThumbnail($source_kshow->getThumbnail()); $target_thumbnail_path = $target_kshow->getThumbnailPath(); // myContentStorage::moveFile( $content . $source_thumbnail_path , $content . $target_thumbnail_path , false , true ); $target_kshow->save(); // copy the show_entry file content $source_show_entry = entryPeer::retrieveByPK($source_kshow->getShowEntryId()); $source_show_entry_data_key = $source_show_entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA); $target_show_entry->setData(null); $target_show_entry->setData($source_show_entry->getData()); $target_show_entry_data_key = $target_show_entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA); $target_show_entry->setName($source_show_entry->getName()); $target_show_entry->setLengthInMsecs($source_show_entry->getLengthInMsecs()); kFileSyncUtils::softCopy($source_show_entry_data_key, $target_show_entry_data_key); //myContentStorage::moveFile( $content . $source_show_entry_path , $content . $target_show_entry_path , false , true ); myEntryUtils::createThumbnail($target_show_entry, $source_show_entry, true); // $target_kshow->setHasRoughcut(true); // $target_kshow->save(); $target_show_entry->save(); return $target_kshow; }