5
5
*/
6
6
namespace Magento \Catalog \Block \Adminhtml \Product \Edit \Action \Attribute \Tab ;
7
7
8
- use Magento \Customer \Api \Data \GroupInterface ;
9
-
10
8
/**
11
9
* Products mass update inventory tab
12
10
*
@@ -31,11 +29,6 @@ class Inventory extends \Magento\Backend\Block\Widget implements \Magento\Backen
31
29
*/
32
30
protected $ disabledFields = [];
33
31
34
- /**
35
- * @var \Magento\Framework\Serialize\SerializerInterface
36
- */
37
- private $ serializer ;
38
-
39
32
/**
40
33
* @param \Magento\Backend\Block\Template\Context $context
41
34
* @param \Magento\CatalogInventory\Model\Source\Backorders $backorders
@@ -46,13 +39,10 @@ public function __construct(
46
39
\Magento \Backend \Block \Template \Context $ context ,
47
40
\Magento \CatalogInventory \Model \Source \Backorders $ backorders ,
48
41
\Magento \CatalogInventory \Api \StockConfigurationInterface $ stockConfiguration ,
49
- array $ data = [],
50
- \Magento \Framework \Serialize \SerializerInterface $ serializer = null
42
+ array $ data = []
51
43
) {
52
44
$ this ->_backorders = $ backorders ;
53
45
$ this ->stockConfiguration = $ stockConfiguration ;
54
- $ this ->serializer = $ serializer ?? \Magento \Framework \App \ObjectManager::getInstance ()
55
- ->get (\Magento \Framework \Serialize \SerializerInterface::class);
56
46
parent ::__construct ($ context , $ data );
57
47
}
58
48
@@ -80,11 +70,11 @@ public function getFieldSuffix()
80
70
* Retrieve current store id
81
71
*
82
72
* @return int
73
+ * @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
83
74
*/
84
75
public function getStoreId ()
85
76
{
86
- $ storeId = $ this ->getRequest ()->getParam ('store ' );
87
- return (int ) $ storeId ;
77
+ return (int )$ this ->getRequest ()->getParam ('store ' );
88
78
}
89
79
90
80
/**
@@ -98,21 +88,6 @@ public function getDefaultConfigValue($field)
98
88
return $ this ->stockConfiguration ->getDefaultConfigValue ($ field );
99
89
}
100
90
101
- /**
102
- * Returns min_sale_qty configuration for the ALL Customer Group
103
- * @return int
104
- */
105
- public function getDefaultMinSaleQty ()
106
- {
107
- $ default = $ this ->stockConfiguration ->getDefaultConfigValue ('min_sale_qty ' );
108
- if (!is_numeric ($ default )) {
109
- $ default = $ this ->serializer ->unserialize ($ default );
110
- $ default = isset ($ default [GroupInterface::CUST_GROUP_ALL ]) ? $ default [GroupInterface::CUST_GROUP_ALL ] : 1 ;
111
- }
112
-
113
- return (int ) $ default ;
114
- }
115
-
116
91
/**
117
92
* Tab settings
118
93
*
@@ -124,6 +99,8 @@ public function getTabLabel()
124
99
}
125
100
126
101
/**
102
+ * Return Tab title.
103
+ *
127
104
* @return \Magento\Framework\Phrase
128
105
*/
129
106
public function getTabTitle ()
@@ -132,22 +109,24 @@ public function getTabTitle()
132
109
}
133
110
134
111
/**
135
- * @return bool
112
+ * @inheritdoc
136
113
*/
137
114
public function canShowTab ()
138
115
{
139
116
return true ;
140
117
}
141
118
142
119
/**
143
- * @return bool
120
+ * @inheritdoc
144
121
*/
145
122
public function isHidden ()
146
123
{
147
124
return false ;
148
125
}
149
126
150
127
/**
128
+ * Get availability status.
129
+ *
151
130
* @param string $fieldName
152
131
* @return bool
153
132
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
0 commit comments