@@ -22,11 +22,11 @@ protected function _construct()
2222 * @return $this
2323 * @throws LocalizedException
2424 */
25- protected function _afterSave (AbstractModel $ object )
25+ protected function _afterSave ($ tag )
2626 {
27- $ this ->_saveTagProducts ($ object );
28- $ this ->_saveTagStores ($ object );
29- return parent ::_afterSave ($ object );
27+ $ this ->_saveTagProducts ($ tag );
28+ $ this ->_saveTagStores ($ tag );
29+ return parent ::_afterSave ($ tag );
3030 }
3131
3232 public function getTagProductTable ()
@@ -129,10 +129,10 @@ protected function _saveTagProducts($tag)
129129 }
130130 protected function _saveTagStores ($ tag )
131131 {
132- $ oldStores = $ this ->lookupStoreIds ($ object ->getId ());
133- $ newStores = (array )$ object ->getStores ();
132+ $ oldStores = $ this ->lookupStoreIds ($ tag ->getId ());
133+ $ newStores = (array )$ tag ->getStores ();
134134 if (empty ($ newStores )) {
135- $ newStores = (array )$ object ->getStoreId ();
135+ $ newStores = (array )$ tag ->getStoreId ();
136136 }
137137 $ table = $ this ->getTable ('lof_producttags_store ' );
138138 $ insert = array_diff ($ newStores , $ oldStores );
@@ -144,7 +144,7 @@ protected function _saveTagStores($tag)
144144 if ($ insert ) {
145145 $ data = [];
146146 foreach ($ insert as $ storeId ) {
147- $ data [] = ['tag_id ' => (int )$ object ->getId (), 'store_id ' => (int )$ storeId ];
147+ $ data [] = ['tag_id ' => (int )$ tag ->getId (), 'store_id ' => (int )$ storeId ];
148148 }
149149 $ this ->getConnection ()->insertMultiple ($ table , $ data );
150150 }
0 commit comments