Ticketmaster Handler
The Ticketmaster handler (inc/Steps/EventImport/Handlers/Ticketmaster/Ticketmaster.php, TicketmasterSettings) plugs into EventImportStep through HandlerRegistrationTrait so it can be selected inside a Data Machine pipeline. Each execution follows the single-item pattern with automatic pagination: it fetches events from the Ticketmaster API (paginating through results up to MAX_PAGE=19), normalizes the incoming title/date/venue via Utilities/EventIdentifierGenerator::generate($title, $startDate, $venue), checks datamachine_is_item_processed, marks the identifier, and immediately returns the first eligible DataPacket so the pipeline stays incremental.
Configuration & Authentication
- Auth: Ticketmaster uses an auth provider (
TicketmasterAuth) that supplies anapi_key. - Handler settings (from
TicketmasterSettings):classification_type(required),location(lat,lng string),radius(miles), optionalgenre, optionalvenue_id, optionalsearch, optionalexclude_keywords.
Data Mapping
- The handler maps Ticketmaster API responses into a standardized
eventpayload (title, dates/times, venue name, ticket URL, etc.), plus a separatevenue_metadataarray. - The handler stores venue context into
EventEngineData::storeVenueContext()and mergespriceinto engine data (when available). - The handler returns a
DataPacketwhosebodycontains JSON:{ event, venue_metadata, import_source: "ticketmaster" }.
Unique Capabilities
Ticketmaster automatically paginates through API results (up to MAX_PAGE = 19) and returns as soon as it finds the first eligible, unprocessed event. It sets startDateTime to one hour in the future to avoid importing near-immediate past events, filters to events with dates.status.code === "onsale", and supports include/exclude keyword filters.
Pagination
The handler paginates Ticketmaster API results up to MAX_PAGE = 19, advancing pages until it finds the first eligible unprocessed event.
Event Flow
EventImportStepinstantiatesTicketmasterand readsTicketmasterSettingsvalues.- Handler fetches the first eligible event, normalizes identity with
EventIdentifierGenerator, stores venue context viaEventEngineData::storeVenueContext(), and returns a singleDataPacket. EventEngineDatacarries the structured payload into the pipeline.EventUpsertreceives the data, merges engine parameters, runs field-by-field change detection, assigns venue/promoter viaTaxonomyHandler, syncs_datamachine_event_datetime, and optionally downloads featured images.
Every EventUpsert run uses the same identifier hash so duplicates do not slip through.