php - Magento: Is it safe to override event observer core class? -


suppose, there event observer class in core. can override it. but, safe? mean, affect other functions of observer class?

like, if there 2 functions in core observer class , did override 1 function. then, other function work safely before.

i think similar model override , should safe. right?

edit:-

for example,

  • there class coreclassa in core.
  • there function corefunctiona in coreclassa.
  • an event core_event_a dispatched in corefunctiona.
  • another core module coremoduleb creating event observer core_event_a.
  • so, whenever core_event_a dispatched, coremoduleb's event observer called.
  • suppose, coremoduleb's event observer contains 2 functions. 1 core_event_a dispatch action (let name eventdispatcha) , other event dispatch action (let's eventdispatchx).
  • in custom module, want override eventdispatcha. basically, want change code in eventdispatcha or, may want skip/omit function. can override it. but, affect eventdispatchx if so? or, there other better way instead of overriding event observer?

most if override others might using it's worth make similar:

    public function samefunction($object){         if(mymodueleisused){             //do different thing         } else {            return parent::samefunction();         }     } 

and others have told : "if in need change/override core doing wrong" , it's better ask in different manner describing want , why


Comments