PluginProbe
Booking Calendar / 11.9
Booking Calendar v11.9
11.9 11.8.4 11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 All 205 releases
booking / includes / page-setup-wizard / interface-wpbc-setup-wizard-step-save-handler.php

interface-wpbc-setup-wizard-step-save-handler.php in Booking Calendar 11.9, at includes/page-setup-wizard/interface-wpbc-setup-wizard-step-save-handler.php

86 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Setup Wizard progressive step-save contracts.
4 *
5 * @package Booking Calendar
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit;
10 }
11
12 /**
13 * Define one domain-owned Setup Wizard step save boundary.
14 *
15 * Implementations are responsible for their own capability, ownership,
16 * edition, validation, canonical persistence, verification, and compensation.
17 * The shared coordinator supplies already normalized wizard fields, but a
18 * canonical handler must still revalidate every domain rule at apply time.
19 */
20 interface WPBC_Setup_Wizard_Step_Save_Handler {
21
22 /**
23 * Return the stable step identifier owned by this handler.
24 *
25 * @return string Stable step ID.
26 */
27 public function get_step_id();
28
29 /**
30 * Return the server-owned primary action label for the current state.
31 *
32 * @param array<string,mixed> $checkpoint Current normalized checkpoint.
33 * @param array<string,mixed> $step_context Authorized presentation context.
34 *
35 * @return string Translated primary action label.
36 */
37 public function get_primary_action_label( array $checkpoint, array $step_context = array() );
38
39 /**
40 * Save one validated step through its domain boundary.
41 *
42 * @param array<string,mixed> $validated_fields Validated current-step fields.
43 * @param array<string,mixed> $checkpoint Current normalized checkpoint.
44 * @param array<string,mixed> $operation_context Stable operation metadata.
45 *
46 * @return array<string,mixed>|WP_Error Domain result or error.
47 */
48 public function save( array $validated_fields, array $checkpoint, array $operation_context );
49
50 /**
51 * Determine whether a successful save completes the active route.
52 *
53 * @return bool True for a terminal step.
54 */
55 public function is_terminal();
56 }
57
58 /**
59 * Define the per-step operation lock required by the progressive coordinator.
60 */
61 interface WPBC_Setup_Wizard_Operation_Lock {
62
63 /**
64 * Acquire one context- and step-scoped operation lock.
65 *
66 * @param string $lock_scope Opaque checkpoint storage scope.
67 * @param string $step_id Stable step identifier.
68 * @param string $operation_id Stable operation identifier.
69 *
70 * @return string|WP_Error Opaque lock token or a busy error.
71 */
72 public function acquire( $lock_scope, $step_id, $operation_id );
73
74 /**
75 * Release a lock only when the caller still owns its token.
76 *
77 * @param string $lock_scope Opaque checkpoint storage scope.
78 * @param string $step_id Stable step identifier.
79 * @param string $lock_token Opaque token returned by acquire().
80 *
81 * @return void
82 */
83 public function release( $lock_scope, $step_id, $lock_token );
84 }
85
86