29 lines
767 B
PHP
29 lines
767 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace PhpQml\Bridge;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* The four `op` values used in the bridge's Mercure envelopes (PLAN.md §4).
|
||
|
|
*
|
||
|
|
* String-backed so `$op->value` is exactly the wire-format token QML
|
||
|
|
* clients see. Encoded as an enum (rather than `string` parameters) so
|
||
|
|
* the typo `'upsret'` is caught at the type level instead of producing
|
||
|
|
* an envelope clients silently ignore.
|
||
|
|
*/
|
||
|
|
enum BridgeOp: string
|
||
|
|
{
|
||
|
|
/** Entity created or updated. */
|
||
|
|
case Upsert = 'upsert';
|
||
|
|
|
||
|
|
/** Entity removed. */
|
||
|
|
case Delete = 'delete';
|
||
|
|
|
||
|
|
/** Whole-collection replacement (e.g. server-side reset / re-seed). */
|
||
|
|
case Replace = 'replace';
|
||
|
|
|
||
|
|
/** Domain event on `app://event/{name}` topic — not tied to a model row. */
|
||
|
|
case Event = 'event';
|
||
|
|
}
|