summaryrefslogtreecommitdiff
path: root/src/application/mystic/forum/orm/Post.php
blob: 186ea61ab3c37f6a8a6d1db0d90a5c9e4e09c494 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
declare(strict_types=1);

namespace mystic\forum\orm;

use mystic\forum\attributes\DefaultValue;
use mystic\forum\attributes\PrimaryKey;
use mystic\forum\attributes\References;
use mystic\forum\attributes\Table;

#[Table("public.posts")]
class Post extends Entity {
    #[PrimaryKey] public string $id;
    public string $content;
    #[References("public.users", onDelete: References::SET_NULL)] public ?string $authorId;
    public \DateTimeImmutable $postDate;
    #[References("public.topics", onDelete: References::CASCADE)] public string $topicId;
    #[DefaultValue("false")] public bool $deleted;
    #[DefaultValue("false")] public bool $edited;
}