0254e40d83
- ADR-003 step 4 (AddOn side): core, requests, bookings, memberships and marketplace adapters no longer register zone=hot fields or contribute hot_* FSM modules; their keys live in TMDO_HivePress_Entity_Groups. Cold/warm registrations are unchanged. - Hot-table doctor probes go with them (trait defaults apply). The hot-clause query rewrite and cron optimizer are now inert and are left for the ADR step-5 removal together with core's hot path. - New NoHotZoneRegistrationTest pins the invariant across all 13 adapters; per-adapter hot assertions removed. - Verify: HP unit 142 / integration 49 green, phpcs clean (WordPress) - PR: PR-037
80 lines
2.2 KiB
PHP
80 lines
2.2 KiB
PHP
<?php
|
|
/**
|
|
* Bookings adapter — `hivepress-bookings` (DETECT-ONLY in v3.0.0).
|
|
*
|
|
* The bookings plugin is not installed in the dev environment, so this
|
|
* adapter ships pre-built but only activates when the addon is detected
|
|
* by `TMDO_HivePress_Detector`. Schema is based on HivePress' published
|
|
* Booking model (post_type=hp_booking) — fields are best-effort from the
|
|
* addon's documented field aliases:
|
|
*
|
|
* start_time / end_time → unix timestamp range queries
|
|
* quantity → places booked, hp_quantity (only written when
|
|
* "Allow multiple places" is on)
|
|
* listing → post_parent (already a posts column)
|
|
*
|
|
* These keys are flattened by the `hp_booking_core` entity group
|
|
* (TMDO_HivePress_Entity_Groups); the adapter registers no zone fields.
|
|
*
|
|
* @package WP_Data_Optimizer
|
|
* @since 3.0.0
|
|
*/
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
if ( ! class_exists( 'TMDO_HivePress_Bookings_Adapter' ) ) {
|
|
|
|
/**
|
|
* Bookings addon adapter (detect-only — schema reserved for future install).
|
|
*/
|
|
final class TMDO_HivePress_Bookings_Adapter implements TMDO_HivePress_Adapter {
|
|
|
|
use TMDO_HivePress_Adapter_Trait;
|
|
|
|
/**
|
|
* Constructor — bind register hooks via inherited trait.
|
|
*/
|
|
public function __construct() {
|
|
$this->bind_anti_eav_hooks();
|
|
}
|
|
|
|
/** Adapter slug (matches wp.org plugin slug). */
|
|
public function plugin_slug(): string {
|
|
return 'hivepress-bookings';
|
|
}
|
|
|
|
/** Class probed for addon presence. */
|
|
public function detection_class(): string {
|
|
return 'HivePress\\Bookings\\Plugin';
|
|
}
|
|
|
|
/** Version constant probed for addon presence. */
|
|
public function detection_const(): string {
|
|
return 'HIVEPRESS_BOOKINGS_VERSION';
|
|
}
|
|
|
|
/** Minimum addon version supported. */
|
|
public function minimum_addon_version(): string {
|
|
return '1.0.0';
|
|
}
|
|
|
|
/**
|
|
* 8-D self-score.
|
|
*
|
|
* D8 (perf) reduced to 0.9 because the schema is best-effort from
|
|
* documentation; once the addon is installed and EXPLAIN can verify
|
|
* index usage, raise to 1.0.
|
|
*/
|
|
public function suitability_score(): array {
|
|
return $this->compose_score(
|
|
array(
|
|
'd8_perf' => 0.9,
|
|
)
|
|
);
|
|
}
|
|
}
|
|
|
|
} // end if ( ! class_exists )
|