Hello, I need some help getting some data in cakePhp 3.3.
I have a table events linked to a table guests and a table courses with belongsToMany relations thanks to 2 tables events_guests and courses_events.
For every Event, I have many Guests and Courses.
In a view page for my Guests, I can easily see the Events they attended to but how can I get the lists of the Courses they had? (preferably in alphabetic order).
In my view, I can loop through all the events, and get the related Courses but it seems to be a wrong way to do it.
Thanks for your help.