File tree Expand file tree Collapse file tree 6 files changed +17
-53
lines changed
Controller/Adminhtml/Image Expand file tree Collapse file tree 6 files changed +17
-53
lines changed Original file line number Diff line number Diff line change 13
13
use Magento \Framework \App \Action \HttpPostActionInterface ;
14
14
use Magento \Framework \Controller \Result \JsonFactory ;
15
15
use Magento \Framework \Controller \ResultInterface ;
16
- use Magento \MediaGalleryUiApi \ Api \ GetInsertImageDataInterface ;
16
+ use Magento \MediaGalleryUi \ Model \ InsertImageData \ GetInsertImageData ;
17
17
18
18
/**
19
19
* OnInsert action returns on insert image details
@@ -31,19 +31,19 @@ class OnInsert extends Action implements HttpPostActionInterface
31
31
private $ resultJsonFactory ;
32
32
33
33
/**
34
- * @var GetInsertImageDataInterface
34
+ * @var GetInsertImageData
35
35
*/
36
36
private $ getInsertImageData ;
37
37
38
38
/**
39
39
* @param Context $context
40
40
* @param JsonFactory $resultJsonFactory
41
- * @param GetInsertImageDataInterface|null $getInsertImageData
41
+ * @param GetInsertImageData $getInsertImageData
42
42
*/
43
43
public function __construct (
44
44
Context $ context ,
45
45
JsonFactory $ resultJsonFactory ,
46
- GetInsertImageDataInterface $ getInsertImageData
46
+ GetInsertImageData $ getInsertImageData
47
47
) {
48
48
parent ::__construct ($ context );
49
49
$ this ->resultJsonFactory = $ resultJsonFactory ;
Original file line number Diff line number Diff line change 8
8
9
9
namespace Magento \MediaGalleryUi \Model ;
10
10
11
- use Magento \MediaGalleryUiApi \Api \Data \InsertImageDataInterface ;
12
- use Magento \MediaGalleryUiApi \Api \InsertImageDataExtensionInterface ;
11
+ use Magento \MediaGalleryUi \Model \InsertImageDataExtensionInterface ;
13
12
14
13
/**
15
14
* Class responsible to provide insert image details
@@ -83,7 +82,7 @@ public function getType(): string
83
82
/**
84
83
* Get extension attributes
85
84
*
86
- * @return ? \Magento\MediaGalleryUiApi\Api \InsertImageDataExtensionInterface; |null
85
+ * @return \Magento\MediaGalleryUi\Model \InsertImageDataExtensionInterface|null
87
86
*/
88
87
public function getExtensionAttributes (): ?InsertImageDataExtensionInterface
89
88
{
@@ -93,10 +92,10 @@ public function getExtensionAttributes(): ?InsertImageDataExtensionInterface
93
92
/**
94
93
* Set extension attributes
95
94
*
96
- * @param ? \Magento\MediaGalleryUiApi\Api \InsertImageDataExtensionInterface;|null $extensionAttributes
95
+ * @param \Magento\MediaGalleryUi\Model \InsertImageDataExtensionInterface $extensionAttributes
97
96
* @return void
98
97
*/
99
- public function setExtensionAttributes (? InsertImageDataExtensionInterface $ extensionAttributes ): void
98
+ public function setExtensionAttributes (InsertImageDataExtensionInterface $ extensionAttributes ): void
100
99
{
101
100
$ this ->extensionAttributes = $ extensionAttributes ;
102
101
}
Original file line number Diff line number Diff line change 14
14
use Magento \Framework \Filesystem ;
15
15
use Magento \Framework \Filesystem \Directory \ReadInterface ;
16
16
use Magento \MediaGalleryUi \Model \InsertImageDataFactory ;
17
- use Magento \MediaGalleryUiApi \Api \Data \InsertImageDataInterface ;
18
- use Magento \MediaGalleryUiApi \Api \GetInsertImageDataInterface ;
17
+ use Magento \MediaGalleryUi \Model \InsertImageDataInterface ;
19
18
20
- class GetInsertImageData implements GetInsertImageDataInterface
19
+ class GetInsertImageData
21
20
{
22
21
/**
23
22
* @var ReadInterface
@@ -115,9 +114,9 @@ private function getSize(string $path): int
115
114
*/
116
115
public function getType (string $ path ): string
117
116
{
118
- $ absoluteFilePath = $ this ->getPubDirectory ()->getAbsolutePath ($ path );
117
+ $ fileExist = $ this ->getPubDirectory ()->isExist ($ path );
119
118
120
- return $ this ->getPubDirectory ()-> isExist ( $ path ) ? $ this ->mime -> getMimeType ( $ absoluteFilePath ) : '' ;
119
+ return $ fileExist ? $ this ->mime -> getMimeType ( $ this ->getPubDirectory ()-> getAbsolutePath ( $ path ) ) : '' ;
121
120
}
122
121
123
122
/**
Original file line number Diff line number Diff line change 6
6
7
7
declare (strict_types=1 );
8
8
9
- namespace Magento \MediaGalleryUiApi \ Api \ Data ;
9
+ namespace Magento \MediaGalleryUi \ Model ;
10
10
11
11
use Magento \Framework \Api \ExtensibleDataInterface ;
12
12
@@ -39,17 +39,17 @@ public function getType(): string;
39
39
/**
40
40
* Get extension attributes
41
41
*
42
- * @return \Magento\MediaGalleryUiApi\Api \InsertImageDataExtensionInterface|null
42
+ * @return \Magento\MediaGalleryUi\Model \InsertImageDataExtensionInterface|null
43
43
*/
44
- public function getExtensionAttributes (): ?\Magento \MediaGalleryUiApi \ Api \InsertImageDataExtensionInterface ;
44
+ public function getExtensionAttributes (): ?\Magento \MediaGalleryUi \ Model \InsertImageDataExtensionInterface ;
45
45
46
46
/**
47
47
* Set extension attributes
48
48
*
49
- * @param \Magento\MediaGalleryUiApi\Api \InsertImageDataExtensionInterface|null $extensionAttributes
49
+ * @param \Magento\MediaGalleryUi\Model \InsertImageDataExtensionInterface $extensionAttributes
50
50
* @return void
51
51
*/
52
52
public function setExtensionAttributes (
53
- ? \Magento \MediaGalleryUiApi \ Api \InsertImageDataExtensionInterface $ extensionAttributes
53
+ \Magento \MediaGalleryUi \ Model \InsertImageDataExtensionInterface $ extensionAttributes
54
54
): void ;
55
55
}
Original file line number Diff line number Diff line change 7
7
-->
8
8
<config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
9
9
<preference for =" Magento\MediaGalleryUiApi\Api\ConfigInterface" type =" Magento\MediaGalleryUi\Model\Config" />
10
- <preference for =" Magento\MediaGalleryUiApi\Api\GetInsertImageDataInterface" type =" \Magento\MediaGalleryUi\Model\InsertImageData\GetInsertImageData" />
11
10
<preference for =" Magento\MediaGalleryUiApi\Api\Data\InsertImageDataInterface" type =" \Magento\MediaGalleryUi\Model\InsertImageData" />
12
11
<type name =" Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory" >
13
12
<arguments >
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments