Tribe__Tickets__Commerce__PayPal__Tickets_View::get_post_attendees_by_purchaser( int $post_id, int|null $user_id )
Groups PayPal ticket attendees by purchaser name/email
Contents
Parameters
- $post_id
-
(int) (Required) The post ID it relates to
- $user_id
-
(int|null) (Required) An optional user ID
Return
(array) Array with the tickets attendees grouped by purchaser name/email
Source
File: src/Tribe/Commerce/PayPal/Tickets_View.php
public function get_post_attendees_by_purchaser( $post_id, $user_id ) {
$attendees = $this->get_post_ticket_attendees( $post_id, $user_id );
if ( ! $attendees ) {
return array();
}
$attendee_groups = array();
foreach ( $attendees as $attendee ) {
$key = $attendee['purchaser_name'] . '::' . $attendee['purchaser_email'];
if ( ! isset( $attendee_groups[ $key ] ) ) {
$attendee_groups[ $key ] = array();
}
$attendee_groups[ $key ][] = $attendee;
}
return $attendee_groups;
}
Changelog
| Version | Description |
|---|---|
| 4.7.1 | Introduced. |