summaryrefslogtreecommitdiff
path: root/src/application/mystic/forum/orm
diff options
context:
space:
mode:
authorJonas Kohl2024-12-26 20:12:34 +0100
committerJonas Kohl2024-12-26 20:12:34 +0100
commit686fff945e0b4697aa74da404ce90534bb7b121d (patch)
treecb5582c8d118cb480f2978fa821950f4a2259401 /src/application/mystic/forum/orm
parent11fed2c8ce3dd38fe686e7b27db738f64373fe3d (diff)
Add async email and topic subscribingv0.7.2
Diffstat (limited to 'src/application/mystic/forum/orm')
-rw-r--r--src/application/mystic/forum/orm/PendingEmail.php19
-rw-r--r--src/application/mystic/forum/orm/Subscription.php14
2 files changed, 33 insertions, 0 deletions
diff --git a/src/application/mystic/forum/orm/PendingEmail.php b/src/application/mystic/forum/orm/PendingEmail.php
new file mode 100644
index 0000000..70622b3
--- /dev/null
+++ b/src/application/mystic/forum/orm/PendingEmail.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace mystic\forum\orm;
+
+use mystic\forum\attributes\PrimaryKey;
+use mystic\forum\attributes\Table;
+use mystic\forum\orm\Entity;
+
+#[Table("public.emails")]
+class PendingEmail extends Entity {
+ #[PrimaryKey] public string $id;
+ public string $sender;
+ public string $recipient;
+ public string $subject;
+ public ?string $htmlBody;
+ public ?string $plaintextBody;
+
+ // TODO Attachments
+}
diff --git a/src/application/mystic/forum/orm/Subscription.php b/src/application/mystic/forum/orm/Subscription.php
new file mode 100644
index 0000000..6934685
--- /dev/null
+++ b/src/application/mystic/forum/orm/Subscription.php
@@ -0,0 +1,14 @@
+<?php
+
+namespace mystic\forum\orm;
+
+use mystic\forum\attributes\PrimaryKey;
+use mystic\forum\attributes\References;
+use mystic\forum\attributes\Table;
+
+#[Table("public.subscriptions")]
+class Subscription extends Entity {
+ #[PrimaryKey] public string $id;
+ #[References("public.topics", onDelete: References::CASCADE)] public string $topicId;
+ #[References("public.users", onDelete: References::CASCADE)] public string $userId;
+}