File tree Expand file tree Collapse file tree 3 files changed +10
-38
lines changed
lib/internal/Magento/Framework/MultiDimensionalIndexer Expand file tree Collapse file tree 3 files changed +10
-38
lines changed Original file line number Diff line number Diff line change 7
7
8
8
namespace Magento \Framework \MultiDimensionalIndexer ;
9
9
10
+ use Magento \Framework \Search \AbstractKeyValuePair ;
11
+
10
12
/**
11
13
* Index Dimension object
12
14
*
13
15
* @api
14
16
*/
15
- class Dimension
17
+ class Dimension extends AbstractKeyValuePair
16
18
{
17
- /**
18
- * @param string $name
19
- * @param string $value
20
- */
21
- public function __construct (string $ name , string $ value )
22
- {
23
- $ this ->name = $ name ;
24
- $ this ->value = $ value ;
25
- }
26
-
27
- /**
28
- * Get dimension name
29
- *
30
- * @return string
31
- */
32
- public function getName (): string
33
- {
34
- return $ this ->name ;
35
- }
36
-
37
- /**
38
- * Get dimension value
39
- *
40
- * @return string
41
- */
42
- public function getValue (): string
43
- {
44
- return $ this ->value ;
45
- }
46
19
}
Original file line number Diff line number Diff line change @@ -30,15 +30,11 @@ public function __construct(ObjectManagerInterface $objectManager)
30
30
}
31
31
32
32
/**
33
- * @param string $name
34
- * @param string $value
33
+ * @param array $arguments
35
34
* @return Dimension
36
35
*/
37
- public function create (string $ name , $ value ): Dimension
36
+ public function create (array $ arguments = [] ): Dimension
38
37
{
39
- return $ this ->objectManager ->create (Dimension::class, [
40
- 'name ' => $ name ,
41
- 'value ' => (string ) $ value ,
42
- ]);
38
+ return $ this ->objectManager ->create (Dimension::class, $ arguments );
43
39
}
44
40
}
Original file line number Diff line number Diff line change @@ -83,7 +83,10 @@ public function setIndexId(string $indexId): self
83
83
*/
84
84
public function addDimension (string $ name , string $ value ): self
85
85
{
86
- $ this ->data [self ::$ dimensions ][] = $ this ->dimensionFactory ->create ($ name , $ value );
86
+ $ this ->data [self ::$ dimensions ][] = $ this ->dimensionFactory ->create ([
87
+ 'name ' => $ name ,
88
+ 'value ' => $ value ,
89
+ ]);
87
90
return $ this ;
88
91
}
89
92
You can’t perform that action at this time.
0 commit comments