@@ 16-33 (lines=18) @@ | ||
13 | * |
|
14 | * @author Andrey Girnik <[email protected]> |
|
15 | */ |
|
16 | class LocalUploadController extends CommonUploadController |
|
17 | { |
|
18 | /** |
|
19 | * Get local upload component. |
|
20 | * |
|
21 | * @throws InvalidConfigException |
|
22 | * |
|
23 | * @return UploadComponentInterface |
|
24 | */ |
|
25 | protected function getUploadComponent(): UploadComponentInterface |
|
26 | { |
|
27 | $uploadComponent = $this->module->get('local-upload-component'); |
|
28 | ||
29 | if (!($uploadComponent instanceof UploadComponentInterface)) { |
|
30 | throw new InvalidConfigException("local-upload-component must be implemented of UploadComponentInterface."); |
|
31 | } |
|
32 | ||
33 | return $uploadComponent; |
|
34 | } |
|
35 | } |
|
36 |
@@ 16-33 (lines=18) @@ | ||
13 | * |
|
14 | * @author Andrey Girnik <[email protected]> |
|
15 | */ |
|
16 | class S3UploadController extends CommonUploadController |
|
17 | { |
|
18 | /** |
|
19 | * Get s3 upload component. |
|
20 | * |
|
21 | * @throws InvalidConfigException |
|
22 | * |
|
23 | * @return UploadComponentInterface |
|
24 | */ |
|
25 | protected function getUploadComponent(): UploadComponentInterface |
|
26 | { |
|
27 | $uploadComponent = $this->module->get('s3-upload-component'); |
|
28 | ||
29 | if (!($uploadComponent instanceof UploadComponentInterface)) { |
|
30 | throw new InvalidConfigException("s3-upload-component must be implemented of UploadComponentInterface."); |
|
31 | } |
|
32 | ||
33 | return $uploadComponent; |
|
34 | } |
|
35 | } |
|
36 |