/** * @param int $streamChannelId * @param CM_File $archiveSource */ public function importVideoArchive($streamChannelId, CM_File $archiveSource) { $streamChannelArchive = new CM_Model_StreamChannelArchive_Video($streamChannelId); $archiveDestination = $streamChannelArchive->getVideo(); $archiveDestination->ensureParentDirectory(); $archiveSource->copyToFile($archiveDestination); }
/** * @param CM_Model_StreamChannelArchive_Video $archive * @return CM_File[] */ private function _createArchiveFiles(CM_Model_StreamChannelArchive_Video $archive) { $files = array(); if ($archive->getThumbnailCount() > 0) { /** @var CM_File_UserContent $thumbnailFirst */ $thumbnailFirst = $archive->getThumbnails()->getItem(0); $thumbnailFirst->ensureParentDirectory(); $files[] = $thumbnailFirst->getParentDirectory(); } for ($i = 0; $i < $archive->getThumbnailCount(); $i++) { /** @var CM_File_UserContent $file */ $file = $archive->getThumbnails()->getItem($i); $file->write(''); $files[] = $file; } $video = $archive->getVideo(); $video->ensureParentDirectory(); $video->write(''); $files[] = $video; return $files; }