File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
app/code/Magento/CatalogUrlRewrite/Model/ResourceModel/Category Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,27 @@ public function removeMultiple(array $removeData)
86
86
*/
87
87
public function removeMultipleByProductCategory (array $ filter )
88
88
{
89
- return $ this ->getConnection ()->deleteFromSelect ($ this ->prepareSelect ($ filter ), self ::TABLE_NAME );
89
+ return $ this ->getConnection ()->deleteFromSelect ($ this ->prepareJoin ($ filter ), self ::TABLE_NAME );
90
+ }
91
+
92
+ /**
93
+ * Prepare select statement for specific filter
94
+ *
95
+ * @param array $data
96
+ * @return \Magento\Framework\DB\Select
97
+ */
98
+ private function prepareJoin ($ data )
99
+ {
100
+ $ select = $ this ->getConnection ()->select ();
101
+ $ select ->from (DbStorage::TABLE_NAME );
102
+ $ select ->join (
103
+ self ::TABLE_NAME ,
104
+ DbStorage::TABLE_NAME . '.url_rewrite_id = ' . self ::TABLE_NAME . '.url_rewrite_id '
105
+ );
106
+ foreach ($ data as $ column => $ value ) {
107
+ $ select ->where (DbStorage::TABLE_NAME . '. ' . $ column . ' IN (?) ' , $ value );
108
+ }
109
+ return $ select ;
90
110
}
91
111
92
112
/**
You can’t perform that action at this time.
0 commit comments