26 lines
706 B
PHP
26 lines
706 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace PhpQml\Bridge\Attribute;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Marks a Doctrine entity as a reactive bridge resource.
|
||
|
|
*
|
||
|
|
* Tagged entities have their persist/update/remove events automatically
|
||
|
|
* mirrored onto the Mercure topics `app://model/{name}` and
|
||
|
|
* `app://model/{name}/{id}` (PLAN.md §4 *Push*, §6 *ModelPublisher*).
|
||
|
|
*
|
||
|
|
* The maker generated by Phase 2 sub-commit 4 produces entities with
|
||
|
|
* this attribute pre-attached.
|
||
|
|
*/
|
||
|
|
#[\Attribute(\Attribute::TARGET_CLASS)]
|
||
|
|
final readonly class BridgeResource
|
||
|
|
{
|
||
|
|
public function __construct(
|
||
|
|
/** Logical resource name used in topics. Defaults to lowercased class basename. */
|
||
|
|
public ?string $name = null,
|
||
|
|
) {
|
||
|
|
}
|
||
|
|
}
|