I wonder if anyone could please give me some pointers as to how best to achieve this:
I'm using EventCalendar and EventResources modules. What I want to do is sort the order of calendar events displayed by Resource. For anyone not familiar with the eventresources a resource is stored for each CalendarDateTime record.
CREATE TABLE IF NOT EXISTS `CalendarDateTime_Resources` ( `ID` int(11) NOT NULL auto_increment, `CalendarDateTimeID` int(11) NOT NULL default '0', `EventResourceID` int(11) NOT NULL default '0', `BookingQuantity` int(11) NOT NULL default '0', PRIMARY KEY (`ID`), KEY `CalendarDateTimeID` (`CalendarDateTimeID`), KEY `EventResourceID` (`EventResourceID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
In a simple world I would simply join CalendarDateTime to CalendarDateTime_Resources to return a recordset and then sort by EventResourceID in my calendar display. My uncertaintly is how to approach this the Silverstripe way. Presumably I do not want to touch any of the existing code for EventCalendat or EventResouces, so I'm guessing I need to extend CalendarDateTime to return my joined CalendarDateTime and CalendarDateTime_Resources records?