I have event subscriber, which is listening on doctrines events:
return [
Events::postPersist,
Events::postUpdate,
Events::postRemove,
];
It is working ok, but what I need is in specific application operation (called from command) disable this event to trigger subscriber. My idea is somehow detect from which scope was called flush(), is there a way like debug_backrace() (which I don't want use obv.) to detect context of application?