本文整理匯總了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;
}