Abstract_REST_Endpoint::get_mapped_attendees_from_queue( TECEvent_AutomatorZapierRESTV1Endpointsarray $current_queue, bool $add_updated_id, string $empty_code, string $no_valid_code )
Retrieves a list of mapped attendees from the specified queue.
Contents
Parameters
- $current_queue
-
(<span class="TECEvent_AutomatorZapierRESTV1EndpointsarrayTECEvent_AutomatorZapierRESTV1Endpointsarray<string|">TECEvent_AutomatorZapierRESTV1Endpointsmixed>) (Required) The queue of attendee IDs to be processed.
- $add_updated_id
-
(bool) (Required) Whether to add updated IDs to the attendees array.
- $empty_code
-
(string) (Required) The code to return if the current queue is empty.
- $no_valid_code
-
(string) (Required) The code to return if no valid attendees are found.
Return
(TECEvent_AutomatorZapierRESTV1Endpointsarray<string|TECEvent_AutomatorZapierRESTV1Endpointsmixed>) An array of mapped attendees or an array with a specific 'id' code.
Source
File: src/Common/Event_Automator/Zapier/REST/V1/Endpoints/Abstract_REST_Endpoint.php
public function get_mapped_attendees_from_queue( $current_queue, bool $add_updated_id, string $empty_code, string $no_valid_code ) {
if ( empty( $current_queue ) ) {
return [ [ 'id' => $empty_code ] ];
}
$attendees = [];
foreach ( $current_queue as $next_attendee_id ) {
// Ensure that $next_attendee_id is numeric before typecasting to integer.
if ( ! is_numeric( $next_attendee_id ) ) {
continue;
}
$next_attendee_id = (int) $next_attendee_id;
$next_attendee = $this->get_mapped_attendee( $next_attendee_id, $add_updated_id );
if ( empty( $next_attendee ) ) {
continue;
}
$attendees[] = $next_attendee;
}
return ! empty( $attendees ) ? $attendees : [ [ 'id' => $no_valid_code ] ];
}
Changelog
| Version | Description |
|---|---|
| 6.0.0 | Introduced. |