0

We listen to various explicit and implicit events dispatched in Magento and hook up methods to perform our own logic.

But the thing i have wondered is, is there a way to know what objects i am able to access in the observer method specially for some explicitly called events, rather than going and looking at where the event is dispatched.

Is there a way by which we know which objects are passed in Varien_Event_Observer param?

  • 2
    a simple way to do it is to call the getData() method which returns an array of objects – Alex Dinca Jun 23 '14 at 14:18
1

As Alex Dinca says you can use $observer->getData() and log to print it out somewhere, however I think the best way is to use a debugger such as xDebug or Zend Debugger, set a break point in your observer and then you will be able to see what is contained within $observer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.