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