当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Event_BAO_Event::query方法代码示例

本文整理汇总了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;
        }
    }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:39,代码来源:ConferenceEvents.php


注:本文中的CRM_Event_BAO_Event::query方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。