@@ -187,7 +187,7 @@ protected function processRatingCodes(\Magento\Framework\Model\AbstractModel $ob
187
187
->where ('rating_id = :rating_id ' );
188
188
$ old = $ connection ->fetchPairs ($ select , [':rating_id ' => $ ratingId ]);
189
189
$ new = array_filter (array_map ('trim ' , $ object ->getRatingCodes ()));
190
- $ this ->deleteRatingData ($ ratingId , $ table , array_diff_assoc ($ old , $ new ));
190
+ $ this ->deleteRatingData ($ ratingId , $ table , array_keys ( array_diff_assoc ($ old , $ new) ));
191
191
192
192
$ insert = [];
193
193
foreach (array_diff_assoc ($ new , $ old ) as $ storeId => $ title ) {
@@ -210,10 +210,10 @@ protected function processRatingStores(\Magento\Framework\Model\AbstractModel $o
210
210
->where ('rating_id = :rating_id ' );
211
211
$ old = $ connection ->fetchCol ($ select , [':rating_id ' => $ ratingId ]);
212
212
$ new = $ object ->getStores ();
213
- $ this ->deleteRatingData ($ ratingId , $ table , array_diff_assoc ($ old , $ new ));
213
+ $ this ->deleteRatingData ($ ratingId , $ table , array_diff ($ old , $ new ));
214
214
215
215
$ insert = [];
216
- foreach (array_keys ( array_diff_assoc ( $ new , $ old) ) as $ storeId ) {
216
+ foreach (array_diff ( $ new , $ old ) as $ storeId ) {
217
217
$ insert [] = ['rating_id ' => $ ratingId , 'store_id ' => (int )$ storeId ];
218
218
}
219
219
$ this ->insertRatingData ($ table , $ insert );
@@ -223,18 +223,18 @@ protected function processRatingStores(\Magento\Framework\Model\AbstractModel $o
223
223
/**
224
224
* @param int $ratingId
225
225
* @param string $table
226
- * @param array $data
226
+ * @param array $storeIds
227
227
* @return void
228
228
*/
229
- protected function deleteRatingData ($ ratingId , $ table , array $ data )
229
+ protected function deleteRatingData ($ ratingId , $ table , array $ storeIds )
230
230
{
231
- if (empty ($ data )) {
231
+ if (empty ($ storeIds )) {
232
232
return ;
233
233
}
234
234
$ connection = $ this ->getConnection ();
235
235
$ connection ->beginTransaction ();
236
236
try {
237
- $ where = ['rating_id = ? ' => $ ratingId , 'store_id IN(?) ' => array_keys ( $ data ) ];
237
+ $ where = ['rating_id = ? ' => $ ratingId , 'store_id IN(?) ' => $ storeIds ];
238
238
$ connection ->delete ($ table , $ where );
239
239
$ connection ->commit ();
240
240
} catch (\Exception $ e ) {
0 commit comments