I have an observer listening for events that fire sales_order_creditmemo_save_after. The issue I have is that when a credit memo is saved on the invoice, the sales_order_invoice_save_after event is also fired - which causes issues with my code, because I also have another observer listening on that event.
For the observer listening on sales_order_invoice_save_after - is there a way to distinguish whether the event was a credit memo or an invoice?
I have found deep down in the $observer object, protected '_historyEntityName' => string 'creditmemo' (length=10) however is there a more standard way to access this information?
_historyEntityName. It is used very rarely and you do not have any chance to access it from the outside. – Simon Feb 19 '15 at 08:04