File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -236,10 +236,15 @@ public function _saveAction()
236236 }
237237 $ model ->addData ($ params );
238238
239+ $ this ->_eventManager ->dispatch ('magefan_ ' . $ this ->getRequest ()->getModuleName () . '_ ' . $ this ->getRequest ()->getControllerName () . '_form_before_save ' , ['model ' => $ model ]);
240+
239241 $ this ->_beforeSave ($ model , $ request );
240242 $ model ->save ();
243+
241244 $ this ->_afterSave ($ model , $ request );
242245
246+ $ this ->_eventManager ->dispatch ('magefan_ ' . $ this ->getRequest ()->getModuleName () . '_ ' . $ this ->getRequest ()->getControllerName () . '_form_after_save ' , ['model ' => $ model ]);
247+
243248 $ this ->messageManager ->addSuccess (__ ('%1 has been saved. ' , $ model ->getOwnTitle ()));
244249 $ this ->_setFormData (false );
245250 } catch (\Magento \Framework \Exception \LocalizedException $ e ) {
@@ -521,6 +526,7 @@ protected function _getModel($load = true)
521526
522527 if ($ id && $ load ) {
523528 $ this ->_model ->load ($ id );
529+ $ this ->_eventManager ->dispatch ('magefan_ ' . $ this ->getRequest ()->getModuleName () . '_ ' . $ this ->getRequest ()->getControllerName () . '_form_load_model_after ' , ['model ' => $ this ->_model ]);
524530 }
525531 }
526532 return $ this ->_model ;
You can’t perform that action at this time.
0 commit comments