2 class CRM_Event_Cart_BAO_Conference
{
3 //XXX assumes we don't allow a contact to register for the same conference more than once
4 //XXX flattens the object tree for convenient templating
5 static function get_participant_sessions($main_event_participant_id) {
7 SELECT sub_event.* FROM civicrm_participant main_participant
8 JOIN civicrm_event sub_event ON sub_event.parent_event_id = main_participant.event_id
9 JOIN civicrm_participant sub_participant ON sub_participant.event_id = sub_event.id
11 civicrm_option_value slot ON sub_event.slot_label_id = slot.value
13 civicrm_option_group og ON slot.option_group_id = og.id
15 main_participant.id = %1
16 AND sub_participant.contact_id = main_participant.contact_id
17 AND og.name = 'conference_slot'
22 $sql_args = array(1 => array($main_event_participant_id, 'Integer'));
23 $dao = CRM_Core_DAO
::executeQuery($sql, $sql_args);
24 $smarty_sessions = array();
25 while ($dao->fetch()) {
26 $smarty_sessions[] = get_object_vars($dao);
28 if (empty($smarty_sessions)) {
31 return $smarty_sessions;