diff options
author | Jonas Kohl | 2024-09-08 17:53:55 +0200 |
---|---|---|
committer | Jonas Kohl | 2024-09-08 17:53:55 +0200 |
commit | 415a0a96a76afbe7f1ad2f51862641793caf1b6c (patch) | |
tree | 1168316bff6a2ec04ee27db5ada5431ba6631ce4 /src/application/mystic/forum/attributes/References.php |
Initial commit
Diffstat (limited to 'src/application/mystic/forum/attributes/References.php')
-rw-r--r-- | src/application/mystic/forum/attributes/References.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/application/mystic/forum/attributes/References.php b/src/application/mystic/forum/attributes/References.php new file mode 100644 index 0000000..ac431ff --- /dev/null +++ b/src/application/mystic/forum/attributes/References.php @@ -0,0 +1,15 @@ +<?php + +namespace mystic\forum\attributes; + +#[\Attribute(\Attribute::TARGET_PROPERTY)] +class References { + public function __construct( + public readonly string $foreignTableName, + public readonly ?string $foreignColumnName = null, + ) {} + + public function __toString(): string { + return $this->foreignTableName . ($this->foreignColumnName !== null ? " ({$this->foreignColumnName})" : ""); + } +} |