File tree 1 file changed +11
-3
lines changed
app/code/Magento/Review/Ui/DataProvider/Product
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 12
12
use Magento \Review \Model \Review ;
13
13
14
14
/**
15
- * Class ReviewDataProvider
15
+ * DataProvider Product ReviewDataProvider
16
16
*
17
17
* @api
18
18
*
@@ -58,14 +58,22 @@ public function __construct(
58
58
}
59
59
60
60
/**
61
- * { @inheritdoc}
61
+ * @inheritdoc
62
62
* @since 100.1.0
63
63
*/
64
64
public function getData ()
65
65
{
66
66
$ this ->getCollection ()->addEntityFilter ($ this ->request ->getParam ('current_product_id ' , 0 ))
67
67
->addStoreData ();
68
68
69
+ $ params = $ this ->request ->getParams ();
70
+ if (isset ($ params ['sorting ' ])) {
71
+ $ sorting = $ params ['sorting ' ];
72
+ $ field = $ sorting ['field ' ];
73
+ $ direction = $ sorting ['direction ' ];
74
+ $ this ->getCollection ()->getSelect ()->order ($ field . ' ' . $ direction );
75
+ }
76
+
69
77
$ arrItems = [
70
78
'totalRecords ' => $ this ->getCollection ()->getSize (),
71
79
'items ' => [],
@@ -79,7 +87,7 @@ public function getData()
79
87
}
80
88
81
89
/**
82
- * { @inheritdoc}
90
+ * @inheritdoc
83
91
* @since 100.1.0
84
92
*/
85
93
public function addFilter (\Magento \Framework \Api \Filter $ filter )
You can’t perform that action at this time.
0 commit comments