Fleet, Dual-Source & Routing
Charter supports both native Entries fleets (charter-yachts) and existing ProcessWire Page templates (fleet_source: 'page') through a unified YachtSubjectResolver and CharterYachtResource (charter_yacht) abstraction.
1. Dual-Source Fleet (YachtSubjectResolver & charter:scaffold:page)
Section titled “1. Dual-Source Fleet (YachtSubjectResolver & charter:scaffold:page)”-
entrymode (default): Yachts live incharter-yachts, normalized automatically on save byYachtNormalizer(collision-free slugs, padded category-prefixedrefcodes likeGU-00001, normalized seasonal rates, recomputedmin_priceandhas_rates). -
pagemode: Attach Charter’s 5 composable@fieldset:charter-*embedded fields (specs,cabins,amenities,rates,operations) onto an existing ProcessWire template:Terminal window php vendor/bin/wire charter:scaffold:page --template=yacht --sections=specs,cabins,amenities,rates,operations --dry-run --jsonIn
pagemode,ProcessCharteredits yachts seamlessly viaEntries’sDualSourceRecordEditor(?source=page) andCharterWorkspaceManager::createFleetPageProvider().
2. Fleet Search & Facets (FleetSearchService)
Section titled “2. Fleet Search & Facets (FleetSearchService)”$results = $charter->fleet()->search([ 'check_in' => '2026-07-11', 'check_out' => '2026-07-18', 'guests' => 8, 'cabins_min' => 4, 'amenities' => ['seabob', 'jacuzzi'], // AND-matching across amenity pivots 'currency' => 'EUR', 'limit' => 12,]);
$facets = $charter->fleet()->facets();FleetSearchService intersects live [check_in, check_out) availability from AvailabilityEngine, enriches matching yachts with PricingEngine quotes, and returns items, quotes, pagination, filters, and unavailableCount.
3. Frontend Routing & Entity Classes (CharterRouter)
Section titled “3. Frontend Routing & Entity Classes (CharterRouter)”Configure fleet_parent_page, destinations_parent_page, or fleet_templates in Charter Settings -> Routing & Yacht Refs. CharterRouter::resolve($page, $input) evaluates 0/1/2 URL segments (throwing Wire404Exception on unknown or 3+ segment paths) and returns a CharterRouteMatch (kind, isCanonical, canonicalUrl, yachtId, categoryId, destinationId).
Three typed entity classes expose localized URL helpers (url(), httpUrl(), localUrl(), localHttpUrl(), localizedSlug()):
YachtEntry(charter-yachts): Also providesurlInCategory(),canonicalUrl(),hasCategory(),rateBlocks(),allAmenities(), andamenitiesByCategory().YachtCategoryEntry(charter-yacht-categories)DestinationEntry(charter-destinations)
4. Structured JSON Fleet Import (CharterImporter & charter:import)
Section titled “4. Structured JSON Fleet Import (CharterImporter & charter:import)”Import structured JSON yacht catalogs, amenity pivots, and seasonal rates safely via CLI:
php vendor/bin/wire charter:import --path=site/assets/imports/aegean-fleet --mode=skip --dry-run --jsonphp vendor/bin/wire charter:import --path=site/assets/imports/aegean-fleet --mode=upsert --force --json