本文整理汇总了PHP中CRM_Event_BAO_Event::not_waiting_participants方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Event_BAO_Event::not_waiting_participants方法的具体用法?PHP CRM_Event_BAO_Event::not_waiting_participants怎么用?PHP CRM_Event_BAO_Event::not_waiting_participants使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Event_BAO_Event
的用法示例。
在下文中一共展示了CRM_Event_BAO_Event::not_waiting_participants方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_line_item
/**
* Add line item.
*
* @param CRM_Event_BAO_Event $event_in_cart
* @param string $class
*/
public function add_line_item($event_in_cart, $class = NULL)
{
$amount = 0;
$cost = 0;
$not_waiting_participants = array();
foreach ($event_in_cart->not_waiting_participants() as $participant) {
$amount += $participant->cost;
$cost = max($cost, $participant->cost);
$not_waiting_participants[] = array('display_name' => CRM_Contact_BAO_Contact::displayName($participant->contact_id));
}
$waiting_participants = array();
foreach ($event_in_cart->waiting_participants() as $participant) {
$waiting_participants[] = array('display_name' => CRM_Contact_BAO_Contact::displayName($participant->contact_id));
}
$this->line_items[] = array('amount' => $amount, 'cost' => $cost, 'event' => $event_in_cart->event, 'participants' => $not_waiting_participants, 'num_participants' => count($not_waiting_participants), 'num_waiting_participants' => count($waiting_participants), 'waiting_participants' => $waiting_participants, 'class' => $class);
$this->sub_total += $amount;
}