AXIAM PHP SDK

ManifestEntity
in package

FinalYes

One entity a §27.6 manifest declares must exist.

Entities are addressed by a manifest-local $key, never by a server-assigned UUID. That is what lets the same manifest run against a fresh tenant and an existing one and mean the same thing (§27.6: a plan must be STABLE ACROSS RUNS) — a UUID does not exist until the first apply, so a manifest written in terms of UUIDs could only ever describe a tenant that already matched it.

Table of Contents

Properties

$depends  : array<string|int, mixed>
$expectedKinds  : array<string|int, mixed>
$fields  : array<string|int, mixed>
$key  : string
$kind  : ManifestKind
$name  : string
$segment  : string|null
$setFields  : array<string|int, mixed>

Methods

__construct()  : mixed
drift()  : array<string, mixed>
The fields of `$existing` that disagree with this declaration.

Properties

$depends read-only

public array<string|int, mixed> $depends = []

$expectedKinds read-only

public array<string|int, mixed> $expectedKinds = []

$setFields read-only

public array<string|int, mixed> $setFields = []

Methods

__construct()

public __construct(ManifestKind $kind, string $key, string $name[, array<string, mixed> $fields = [] ][, array<int, string> $depends = [] ][, array<string, ManifestKind> $expectedKinds = [] ][, array<int, string> $setFields = [] ][, string|null $segment = null ]) : mixed
Parameters
$kind : ManifestKind

What sort of object this is.

$key : string

Manifest-local identity, unique within its kind.

$name : string

The name the server knows it by; also how an existing object is matched to this declaration.

$fields : array<string, mixed> = []

Desired field values, by wire name.

$depends : array<int, string> = []

Keys of entities that must be applied first, beyond what ManifestKind already orders.

$expectedKinds : array<string, ManifestKind> = []

CONTRACT 1.52 N6.6 (C-12): for a $depends entry that names another entity BY KIND (a resource's parent, a binding's role or resource) — maps that dependency's KEY to the kind it must resolve to, so ManifestValidation can refuse a same-named entity of the WRONG kind as a dangling reference instead of silently accepting it. A $depends entry with no matching key here (the default, []) falls back to matching any kind — the pre-N6.6 behavior, so a ManifestEntity built by hand (bypassing ManifestBuilder, as some tests do) keeps working exactly as before.

$setFields : array<int, string> = []

CONTRACT 1.62 (§27.6.2 item 3): wire names of list-valued fields compared as a SET — the same names in another order are no drift (network segments' filter_ids). Every other list keeps its order.

$segment : string|null = null

A network_profile's segment: the manifest-local KEY of the network_segment it belongs to. Kept apart from $depends on purpose — the profile's own key IS its segment's, and a dependency edge from a key to itself would be read as a cycle.

drift()

The fields of `$existing` that disagree with this declaration.

public drift(array<string, mixed> $existing) : array<string, mixed>

Compares ONLY the fields the manifest names. A server object carries plenty this manifest says nothing about — timestamps, ids, fields set by another operator — and treating those as drift would make every plan report a change and every apply overwrite work the manifest never claimed.

CONTRACT 1.52 N6.5 (C-12): compared as JSON VALUES, independent of key order — a metadata object the server echoes back with its keys in a different order than this manifest declared them is NOT drift. self::jsonValueEquals() does the comparison; a JSON ARRAY's element order still matters (order is significant for a list, never for an object), only an object's key order is ignored.

CONTRACT 1.62 (§27.6.2): a field stated as PHP null is "none" — it drifts when the server holds a value and not when the server holds none or omits the member — and a field named in $setFields is compared as a set.

Parameters
$existing : array<string, mixed>

The server's current object.

Return values
array<string, mixed> —

The drifted fields and their DESIRED values; empty when converged.

On this page

Search results