summaryrefslogtreecommitdiff
path: root/src/application/mystic/forum/attributes/References.php
blob: ac431ff4272b37934a8921359c4be7b937a728e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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})" : "");
    }
}