Note that there are some explanatory texts on larger screens.

plurals
  1. POMagento: Is it safe to override event observer core class?
    primarykey
    data
    text
    <p>Suppose, there is an event observer class in core. I can override it. But, is it safe? I mean, does it affect other functions of the observer class? </p> <p>Like, if there are two functions in core observer class and I did override only one function. Then, will the other function work safely as before.</p> <p>I think it is similar to model override and should be safe. Am I right?</p> <p><strong>Edit</strong>:-</p> <p>For example,</p> <ul> <li>There is a class <strong>CoreClassA</strong> in core.</li> <li>There is a function <strong>coreFunctionA</strong> in <strong>CoreClassA</strong>.</li> <li>An event <strong>core_event_a</strong> is dispatched in this <strong>coreFunctionA</strong>.</li> <li>Another core module <strong>CoreModuleB</strong> is creating event observer with <strong>core_event_a</strong>. </li> <li>So, whenever <strong>core_event_a</strong> is dispatched, <strong>CoreModuleB</strong>'s event observer is called.</li> <li>Suppose, <strong>CoreModuleB</strong>'s event observer contains two functions. One for <strong>core_event_a</strong> dispatch action (let us name it <strong>eventDispatchA</strong>) and another for some other event dispatch action (let's say <strong>eventDispatchX</strong>).</li> <li>In my custom module, I want to override <strong>eventDispatchA</strong>. <em>Basically, I want to change the some code in eventDispatchA or, I may just want to skip/omit this function</em>. I can override it. <em>But, will it affect <strong>eventDispatchX</strong> if I do so? Or, is there any other better way instead of overriding event observer?</em></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload