9
9
*
10
10
* @author Magento Core Team <core@magentocommerce.com>
11
11
*/
12
+ declare (strict_types=1 );
13
+
12
14
namespace Magento \Catalog \Block \Adminhtml \Category \Tab ;
13
15
14
16
use Magento \Backend \Block \Widget \Grid ;
18
20
use Magento \Catalog \Model \Product \Visibility ;
19
21
use Magento \Framework \App \ObjectManager ;
20
22
23
+ /**
24
+ * Class Product in category grid
25
+ */
21
26
class Product extends \Magento \Backend \Block \Widget \Grid \Extended
22
27
{
23
28
/**
24
- * Core registry
29
+ * Core registry model
25
30
*
26
31
* @var \Magento\Framework\Registry
27
32
*/
@@ -68,6 +73,8 @@ public function __construct(
68
73
}
69
74
70
75
/**
76
+ * Initialize object
77
+ *
71
78
* @return void
72
79
*/
73
80
protected function _construct ()
@@ -79,6 +86,8 @@ protected function _construct()
79
86
}
80
87
81
88
/**
89
+ * Get current category
90
+ *
82
91
* @return array|null
83
92
*/
84
93
public function getCategory ()
@@ -87,6 +96,8 @@ public function getCategory()
87
96
}
88
97
89
98
/**
99
+ * Add column filter to collection
100
+ *
90
101
* @param Column $column
91
102
* @return $this
92
103
*/
@@ -110,6 +121,8 @@ protected function _addColumnFilterToCollection($column)
110
121
}
111
122
112
123
/**
124
+ * Prepare collection.
125
+ *
113
126
* @return Grid
114
127
*/
115
128
protected function _prepareCollection ()
@@ -136,6 +149,7 @@ protected function _prepareCollection()
136
149
'left '
137
150
);
138
151
$ storeId = (int )$ this ->getRequest ()->getParam ('store ' , 0 );
152
+ $ collection ->setStoreId ($ storeId );
139
153
if ($ storeId > 0 ) {
140
154
$ collection ->addStoreFilter ($ storeId );
141
155
}
@@ -153,6 +167,8 @@ protected function _prepareCollection()
153
167
}
154
168
155
169
/**
170
+ * Prepare columns.
171
+ *
156
172
* @return Extended
157
173
*/
158
174
protected function _prepareColumns ()
@@ -230,6 +246,8 @@ protected function _prepareColumns()
230
246
}
231
247
232
248
/**
249
+ * Retrieve grid reload url
250
+ *
233
251
* @return string
234
252
*/
235
253
public function getGridUrl ()
@@ -238,6 +256,8 @@ public function getGridUrl()
238
256
}
239
257
240
258
/**
259
+ * Get selected products
260
+ *
241
261
* @return array
242
262
*/
243
263
protected function _getSelectedProducts ()
0 commit comments