Where to find a list of all eventDispatcher Events?

(Apologies if I am missing an obvious documentation link somewhere)

I am a developer in the process of learning what all can be done with Custom Modules in OpenEMR.

I have watched the lecture series on Custom Modules and I have been scrolling through the source code on github for a bit to familiarize myself.

I have found myself wanting to see a list of all currently existing eventDispatcher events (example below) in order to understand what types of functionalities I could potentially add quickly with Custom Modules.

My fantasy scenario would be a link to some documentation listing every existing event, each with some relevant documentation.

Is there any documentation that exists for this?

If not, is there any better manual search method you would recommend over simply: https://github.com/search?q=repo%3Aopenemr%2Fopenemr%20extends%20Event&type=code

Thanks! I really appreciate any and all assistance!

@Goddard I don’t think there is any documentation on every event in the program. However, if you look in the src folder, is where you will find the event classes.

This should put you on the right track to find all the events in the system. All you need to do is in your IDE search for dispatcher.

@juggernautsei Fantastic! This looks super useful, thank you!

Although at first glance I’m still having a bit of trouble finding exactly what I’m looking for.

For example, if I was trying to create a Custom Module that would perform some action whenever any new Calendar event is created or the duration of any Calendar event was changed (from either the UI or from an API call), what specific “Event” would I need to create a listener for?

Farthest I’ve gotten is AppointmentSetEvent from https://github.com/openemr/openemr/blob/master/src/Events/Appointments/AppointmentSetEvent.php (which it looks like you wrote originally haha) but that looks like its only for new events

I’d love to learn how to find these sorts of answers myself, so if its possible, could you also please explain your process for how you would track down this specific Event? - I really appreciate your help, Big Thanks!

@Goddard look for listeners in the code base. You can use this skeleton that @adunsulag created. Use this as your road map to building modules. If you look at the modules that are in the system now and trace down the event listeners that are in the module do the event and then locate the dispatcher. You can piece together how the Symfony dispatch system works. I have included a link to the docs for the Symfony dispatch system on listeners.

Events and Event Listeners (Symfony Docs)

1 Like