GravityKit\GravityMigrate\Schema\UniversalHub
Which platform every migration passes through, and how a conversion is composed around it.
Every migration runs through one platform in the middle rather than platform to platform: an import is the source platform's leg followed by the hub's, and an export is the hub's leg followed by the target platform's.
Which platform that is comes from the registry, as the one definition answering is_hub(), and is not named anywhere. The hub is a role rather than an identity, so the composition above holds whichever platform fills it.
Since: %ver%
Source: src/Schema/UniversalHub.php:25
Details
- Kind:
class - Namespace:
GravityKit\GravityMigrate\Schema
Methods
| Method | Description |
|---|---|
platform() | The platform every migration passes through. |
definition() | The definition of the platform every migration passes through. |
is_hub() | Whether a platform is the one every migration passes through. |
is_supported_route() | Whether a migration between these two platforms is one this plugin performs. |
Method Reference
platform()
public static function platform(): string
The platform every migration passes through.
Returns
string— Canonical platform id.
Throws
\RuntimeException— When no platform claims the role, or more than one does.
Since: %ver%
Source: src/Schema/UniversalHub.php:36
definition()
public static function definition(): string
The definition of the platform every migration passes through.
Returns
string— Definition class name.
Since: %ver%
Source: src/Schema/UniversalHub.php:63
is_hub()
public static function is_hub( string $platform ): bool
Whether a platform is the one every migration passes through.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$platform | string | Canonical platform id. |
Returns
bool
Since: %ver%
Source: src/Schema/UniversalHub.php:76
is_supported_route()
public static function is_supported_route( string $from, string $to ): bool
Whether a migration between these two platforms is one this plugin performs.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$from | string | Source platform id. | |
$to | string | Target platform id. |
Returns
bool— True when exactly one end is the hub. A route between two platforms that are both the hub, or neither, has no pair of legs to compose.
Since: %ver%
Source: src/Schema/UniversalHub.php:91