本文整理匯總了PHP中CRM_Event_BAO_Event::query方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Event_BAO_Event::query方法的具體用法?PHP CRM_Event_BAO_Event::query怎麽用?PHP CRM_Event_BAO_Event::query使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CRM_Event_BAO_Event
的用法示例。
在下文中一共展示了CRM_Event_BAO_Event::query方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: preProcess
function preProcess()
{
parent::preProcess();
$matches = array();
preg_match("/.*_(\\d+)_(\\d+)/", $this->getAttribute('name'), $matches);
$event_id = $matches[1];
$participant_id = $matches[2];
$event_in_cart = $this->cart->get_event_in_cart_by_event_id($event_id);
$this->conference_event = $event_in_cart->event;
$this->main_participant = $event_in_cart->get_participant_by_id($participant_id);
$this->contact_id = $this->main_participant->contact_id;
$this->main_participant->display_name = CRM_Contact_BAO_Contact::displayName($this->contact_id);
$events = new CRM_Event_BAO_Event();
$query = <<<EOS
\t SELECT
civicrm_event.*,
slot.label AS slot_label
FROM
civicrm_event
JOIN
civicrm_option_value slot ON civicrm_event.slot_label_id = slot.value
JOIN
civicrm_option_group og ON slot.option_group_id = og.id
\t WHERE
\t\tparent_event_id = {$this->conference_event->id}
AND civicrm_event.is_active = 1
AND COALESCE(civicrm_event.is_template, 0) = 0
AND og.name = 'conference_slot'
\t ORDER BY
\t\tslot.weight, start_date
EOS;
$events->query($query);
while ($events->fetch()) {
if (!array_key_exists($events->slot_label, $this->events_by_slot)) {
$this->events_by_slot[$events->slot_label] = array();
}
$this->events_by_slot[$events->slot_label][] = clone $events;
}
}