aboutsummaryrefslogtreecommitdiffhomepage
path: root/WpfTest/Model
diff options
context:
space:
mode:
authorwinter2024-12-07 21:44:42 +0000
committerwinter2024-12-07 21:44:42 +0000
commita84232811dadccf7047424f27340a7f9847bedff (patch)
treea6a0823c8b9485b6a5b60ea7ae854f9511a6ae1e /WpfTest/Model
parente1ad307b531c27ec6bfaf8b4d018991b0d4a78f3 (diff)
many many changes but actors are loaded from db now
Diffstat (limited to 'WpfTest/Model')
-rw-r--r--WpfTest/Model/Actor.php26
-rw-r--r--WpfTest/Model/ActorEndpoints.php15
2 files changed, 41 insertions, 0 deletions
diff --git a/WpfTest/Model/Actor.php b/WpfTest/Model/Actor.php
new file mode 100644
index 0000000..cf8d7ca
--- /dev/null
+++ b/WpfTest/Model/Actor.php
@@ -0,0 +1,26 @@
+<?php
+namespace WpfTest\Model;
+
+use WpfTest\Model;
+
+class Actor extends Model {
+ public int $id;
+ public string $self;
+ public bool $isLocal = false;
+ public \DateTimeImmutable $created;
+ public ?\DateTimeImmutable $modified;
+ public ?string $homepage;
+ public string $handle;
+ public string $displayName;
+ public ?string $avatar;
+ public ?string $bio;
+ public ?string $pronouns;
+ public bool $automated = false;
+ public bool $requestToFollow = false;
+ public ActorEndpoints $endpoints;
+ public array $extensions = [];
+
+ public static function findLocalByHandle(string $handle): ?self {
+ return self::findWhere('is_local = true AND handle = ?', [$handle]);
+ }
+} \ No newline at end of file
diff --git a/WpfTest/Model/ActorEndpoints.php b/WpfTest/Model/ActorEndpoints.php
new file mode 100644
index 0000000..03dab9e
--- /dev/null
+++ b/WpfTest/Model/ActorEndpoints.php
@@ -0,0 +1,15 @@
+<?php
+namespace WpfTest\Model;
+
+use WpfTest\Model;
+
+class ActorEndpoints extends Model {
+ public string $basicFeed;
+ public ?string $fullFeed;
+ public ?string $follow;
+ public ?string $unfollow;
+ public ?string $block;
+ public ?string $unblock;
+ public ?string $subscribe;
+ public ?string $unsubscribe;
+} \ No newline at end of file