1 | <?php |
||
9 | abstract class BaseUrlGenerator |
||
10 | { |
||
11 | /** |
||
12 | * @var \Spatie\MediaLibrary\Media |
||
13 | */ |
||
14 | protected $media; |
||
15 | |||
16 | /** |
||
17 | * @var \Spatie\MediaLibrary\Conversion\Conversion |
||
18 | */ |
||
19 | protected $conversion; |
||
20 | |||
21 | /** |
||
22 | * @var \Spatie\MediaLibrary\PathGenerator\PathGenerator |
||
23 | */ |
||
24 | protected $pathGenerator; |
||
25 | |||
26 | /** |
||
27 | * @var \Illuminate\Contracts\Config\Repository |
||
28 | */ |
||
29 | protected $config; |
||
30 | |||
31 | /** |
||
32 | * @param \Illuminate\Contracts\Config\Repository $config |
||
33 | */ |
||
34 | public function __construct(Config $config) |
||
38 | |||
39 | /** |
||
40 | * @param \Spatie\MediaLibrary\Media $media |
||
41 | * |
||
42 | * @return $this |
||
43 | */ |
||
44 | public function setMedia($media) |
||
50 | |||
51 | /** |
||
52 | * @param \Spatie\MediaLibrary\Conversion\Conversion $conversion |
||
53 | * |
||
54 | * @return $this |
||
55 | */ |
||
56 | public function setConversion(Conversion $conversion) |
||
62 | |||
63 | /** |
||
64 | * @param \Spatie\MediaLibrary\PathGenerator\PathGenerator $pathGenerator |
||
65 | * |
||
66 | * @return $this |
||
67 | */ |
||
68 | public function setPathGenerator(PathGenerator $pathGenerator) |
||
74 | |||
75 | /** |
||
76 | * Get the full url for the profile of a media item. |
||
77 | * |
||
78 | * @return string |
||
79 | * |
||
80 | * @throws \Spatie\MediaLibrary\Exceptions\UrlCouldNotBeDetermined |
||
81 | */ |
||
82 | public function getFullUrl() |
||
86 | |||
87 | /** |
||
88 | * Get the path to the requested file relative to the root of the media directory. |
||
89 | * |
||
90 | * @return string |
||
91 | */ |
||
92 | public function getPathRelativeToRoot() |
||
101 | } |
||
102 |