Tribe__Tickets__Tickets_View::get_event_rsvp_attendees_by_purchaser( int $event_id, int|null $user_id = null )

Groups RSVP attendees by purchaser name/email.


Parameters

$event_id

(int) (Required) The Event ID we're checking.

$user_id

(int|null) (Optional) An optional user ID.

Default value: null


Top ↑

Return

(array) Array with the RSVP attendees grouped by purchaser name/email.


Top ↑

Source

File: src/Tribe/Tickets_View.php

	public function get_event_rsvp_attendees_by_purchaser( $event_id, $user_id = null ) {
		$attendees = $this->get_event_rsvp_attendees( $event_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;
	}