final class Xid
    implements Node
    uses Snapshot
Public API: explicitly declared with @visibility public.

The identifier of an XA transaction: gtrid [, bqual [, formatID]].

Mirrors XID. The global transaction identifier and the branch qualifier are strings of at most 64 bytes each, written as quoted strings or as hexadecimal or bit literals; the format identifier is an unsigned number and defaults to 1. A longer part is a syntax error of the server and cannot be constructed; a format identifier above 2^63-1 is a syntax error from MySQL 5.7 on and is refused when a statement holding it is derived for such a release (MYSQL-SERVER-MAGNITUDE-001). Source: https://dev.mysql.com/doc/refman/8.4/en/xa-statements.html.

Holding the three parts of an identifierdoctest
$xid = new \SqlSemantics\Platform\MySql\Statement\Server\Transaction\Xa\Xid(new \SqlSemantics\Platform\MySql\Statement\Literal\Text('g'), new \SqlSemantics\Platform\MySql\Statement\Literal\Text('b'), new \SqlSemantics\Platform\MySql\Statement\Literal\Numeral('7'));
    [$xid->transaction->value, $xid->branch?->value, $xid->format?->text] // => ['g', 'b', '7']

Properties§

public Text $transaction
public Text|null $branch = null
public Numeral|null $format = null

Methods§

public function __construct(
    public Text $transaction,
    public Text|null $branch = null,
    public Numeral|null $format = null,
)

Parameters

$transactionTextThe global transaction identifier
$branchText|nullThe branch qualifier, when written
$formatNumeral|nullThe format identifier, when written; it needs a branch qualifier

Throws

InvalidConstruction When a part is too long or the format is written without a branch qualifier
Calls 3
public function render(Output $out): void

Writes the parts separated by commas.

Parameters

$outOutput
Calls 2

Test cases 7§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1
Other tests reaching this symbol 6

Relations§

Instantiated in 1
Type declarations 7