1 | <?php |
||
7 | class MediaExporter |
||
8 | { |
||
9 | protected $media; |
||
10 | |||
11 | protected $disk; |
||
12 | |||
13 | protected $format; |
||
14 | |||
15 | protected $visibility; |
||
16 | |||
17 | protected $saveMethod = 'saveAudioOrVideo'; |
||
18 | |||
19 | public function __construct(Media $media) |
||
25 | |||
26 | public function getMedia(): Media |
||
30 | |||
31 | public function getFormat(): FormatInterface |
||
35 | |||
36 | public function inFormat(FormatInterface $format): MediaExporter |
||
42 | |||
43 | protected function getDisk(): Disk |
||
47 | |||
48 | public function toDisk($diskOrName): MediaExporter |
||
58 | |||
59 | public function withVisibility(string $visibility = null) |
||
65 | |||
66 | public function save(string $path): Media |
||
87 | |||
88 | protected function moveSavedFileToRemoteDisk($localSourcePath, File $fileOnRemoteDisk): bool |
||
92 | |||
93 | private function getDestinationPathForSaving(File $file): string |
||
103 | |||
104 | private function createDestinationPathForSaving(File $file) |
||
114 | |||
115 | private function saveAudioOrVideo(string $fullPath): MediaExporter |
||
121 | } |
||
122 |