<?php
/*
+--------------------------------------------------------------------+
-| CiviCRM version 4.5 |
+| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
/**
* @param null $participant
*/
- function __construct($participant = NULL) {
+ public function __construct($participant = NULL) {
parent::__construct();
- $a = (array)$participant;
+ $a = (array) $participant;
$this->copyValues($a);
$this->email = CRM_Utils_Array::value('email', $participant);
* @return CRM_Event_Cart_BAO_MerParticipant
* @throws Exception
*/
- public static function &create($params) {
+ public static function create(&$params) {
$participantParams = array(
'id' => CRM_Utils_Array::value('id', $params),
'role_id' => self::get_attendee_role_id(),
/**
* @return mixed
*/
- static function get_attendee_role_id() {
+ public static function get_attendee_role_id() {
$roles = CRM_Event_PseudoConstant::participantRole(NULL, "v.label='Attendee'");
$role_names = array_keys($roles);
return end($role_names);
/**
* @return mixed
*/
- static function get_pending_in_cart_status_id() {
+ public static function get_pending_in_cart_status_id() {
$status_types = CRM_Event_PseudoConstant::participantStatus(NULL, "name='Pending in cart'");
$status_names = array_keys($status_types);
return end($status_names);
}
/**
- * @param $event_cart_id
+ * @param int $event_cart_id
*
* @return array|null
*/
}
/**
- * @param $event_id
- * @param $event_cart_id
+ * @param int $event_id
+ * @param int $event_cart_id
*
* @return array|null
*/
}
/**
- * @param $params
+ * @param array $params
*
* @return array
*/
}
/**
- * @param $id
+ * @param int $id
*
* @return mixed
*/
return array_pop($results);
}
- function load_associations() {
+ public function load_associations() {
$contact_details = CRM_Contact_BAO_Contact::getContactDetails($this->contact_id);
$this->email = $contact_details[1];
}
/**
* @return int
*/
- function get_participant_index() {
+ public function get_participant_index() {
if (!$this->cart) {
$this->cart = CRM_Event_Cart_BAO_Cart::find_by_id($this->cart_id);
$this->cart->load_associations();
*
* @return null
*/
- static function billing_address_from_contact($contact) {
+ public static function billing_address_from_contact($contact) {
foreach ($contact->address as $loc) {
if ($loc['is_billing']) {
return $loc;
/**
* @return CRM_Event_Cart_Form_MerParticipant
*/
- function get_form() {
+ public function get_form() {
return new CRM_Event_Cart_Form_MerParticipant($this);
}
}
-