Total Complexity | 8 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
11 | trait HasFilesystemTrait |
||
12 | { |
||
13 | protected $filesystem; |
||
14 | |||
15 | /** |
||
16 | * @return FileDisk |
||
17 | */ |
||
18 | public function getFilesystem() |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * @param mixed $filesystem |
||
29 | */ |
||
30 | public function setFilesystem($filesystem) |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @return mixed |
||
37 | */ |
||
38 | public function getBasePathForMedia() |
||
39 | { |
||
40 | $method = 'getBasePathForMedia'; |
||
41 | $manager = $this->getRecord()->getManager(); |
||
|
|||
42 | |||
43 | $media = $this->newMedia(); |
||
44 | |||
45 | if (method_exists($manager, $method)) { |
||
46 | $path = $manager->$method($media); |
||
47 | if (!empty($path)) { |
||
48 | return $path; |
||
49 | } |
||
50 | } |
||
51 | |||
52 | return PathGeneratorFactory::create()::$method($media); |
||
53 | } |
||
54 | |||
55 | protected function initFilesystem() |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * @return FileDisk |
||
62 | */ |
||
63 | protected function generateFilesystem() |
||
66 | } |
||
67 | } |
||
68 |